--- title: Document.URL slug: Web/API/Document/URL tags: - API - Document - Property translation_of: Web/API/Document/URL ---
Возвращает строку URL документа HTML.
string = document.URL
document.getElementById("url").textContent = document.URL;
<p id="urlText">
URL:<br/>
<span id="url">URL goes here</span>
</p>
{{EmbedLiveSample("Example", "100%", 100)}}
Спецификация | Статус | Комментарий |
---|---|---|
{{SpecName("DOM WHATWG", "#dom-document-url", "Document.URL")}} | {{Spec2("DOM WHATWG")}} | Defines that the property is a {{domxref("USVString")}} instead of a {{domxref("DOMString")}}. |
{{SpecName("DOM1", "level-one-html.html#attribute-URL", "Document.URL")}} | {{Spec2("DOM1")}} | Initial definition |
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-dataand send us a pull request.
{{Compat("api.Document.URL")}}