HTML DOM Document URL attribute

Definition and usage

URL The property returns the complete URL of the document.

See also:

window.location.href property

Example

Returns the complete URL of the document:

document.URL;

Try it yourself

Syntax

document.URL

Return value

Type Description
String The entire URL of the document, including the protocol (such as http://).

Browser support

document.URL It is a feature of DOM Level 1 (1998).

All browsers support it:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support 9-11 Support Support Support Support