Skip to main content
property URL.href

The href property of the URL interface is a string that represents the complete URL.

Examples

Example 1

const myURL = new URL('https://foo.example.org/bar?baz=qux#quux');
console.log(myURL.href);  // Logs "https://foo.example.org/bar?baz=qux#quux"

Type

string

See

Back to top