A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/URL/href below:

URL: href property - Web APIs

MDN Web Docs
  1. Web
  2. Web APIs
  3. URL
  4. href

Filter sidebar

In this article
  1. URL API
  2. URL
  3. Constructor
    1. URL()
  4. Instance properties
    1. hash
    2. host
    3. hostname
    4. href
    5. origin
    6. password
    7. pathname
    8. port
    9. protocol
    10. search
    11. searchParams
    12. username
  5. Static methods
    1. canParse()
    2. createObjectURL()
    3. parse()
    4. revokeObjectURL()
  6. Instance methods
    1. toJSON()
    2. toString()
  7. Related pages for URL API
    1. URLSearchParams
  8. Guides
    1. Resolving relative references to a URL
In this article URL: href property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016.

Note: This feature is available in Web Workers.

The href property of the URL interface is a string containing the whole URL.

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 Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on Mar 6, 2024 by MDN contributors.

View this page on GitHub

•

Report a problem with this content

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4