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 URL interface it belongs to.

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.