URL: username property - Web APIs | MDN
Value
A string.
Examples
js
const url = new URL(
"https://anonymous:flabada@developer.mozilla.org/en-US/docs/Web/API/URL/username",
);
console.log(url.username); // Logs "anonymous"
Specifications
| Specification |
|---|
| URL # dom-url-username |
Browser compatibility
See also
- The
URLinterface it belongs to.