MDN wants to talk to developers like you: https://qsurvey.mozilla.com/s3/8d22564490d8

The URL read-only property of the Document interface returns the document location as a string.

Syntax

var string = document.URL 

Example

JavaScript

document.getElementById("urlText").innerHTML = "URL: " + document.URL;

HTML

<p id="urlText">URL goes here.</p>

Result

Specification

Document Tags and Contributors

 Last updated by: xrtariq2594,