HTMLHyperlinkElementUtils.username

The HTMLHyperlinkElementUtils.username property is a USVString containing the username specified before the domain name.

Syntax

string = object.username;
object.username = string;

Examples

// Let's <a id="myAnchor" href="https://anonymous:flabada@developer.mozilla.org/en-US/docs/HTMLHyperlinkElementUtils.username"> be in the document
var anchor = document.getElementByID("myAnchor");
var result = anchor.username; // Returns:'anonymous'

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'HTMLHyperlinkElementUtils.username' in that specification.
Living Standard Initial definition.

Browser compatibility

BCD tables only load in the browser

See also