URL: href property - Web APIs | MDN

Value

A string.

Examples

js

const url = new URL(
  "https://developer.mozilla.org/en-US/docs/Web/API/URL/href",
);
console.log(url.href); // Logs: 'https://developer.mozilla.org/en-US/docs/Web/API/URL/href'

Specifications

Specification
URL
# dom-url-href

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.