Document.URL
Document
インターフェイスの URL
プロパティは読取専用で、文書の位置を文字列で返します。
構文
const url = document.URL
例
JavaScript
document.getElementById("url").textContent = document.URL;
HTML
<p id="urlText">
URL:<br/>
<span id="url">URL goes here</span>
</p>
結果
仕様書
Specification |
---|
DOM Standard # ref-for-dom-document-url① |
ブラウザーの互換性
BCD tables only load in the browser
関連情報
- 同じ値を返す
document.documentURI
プロパティ