X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM URL Property

Document Object Reference Document Object

Example

Get the full URL of the current HTML document:

var x = document.URL;

The result of x will be:

http://www.w3schools.com/jsref/prop_doc_url.asp

Try it yourself »


Definition and Usage

The URL property returns the full URL of the current HTML document.

Note: This property is similar to the location.href property.


Browser Support

Property
URL Yes Yes Yes Yes Yes


Syntax

document.URL

Technical Details

Return Value: A String, representing the entire URL of the document, including the protocol (like http://)
DOM Version Core Level 1 Document Object


Document Object Reference Document Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook