HTMLHyperlinkElementUtils.hash
プロパティは、'#'
の後に URL のフラグメント識別子が続く USVString
を返します。
フラグメントはパーセントデコードされていません。 URL にフラグメント識別子がない場合、このプロパティには空の文字列 ""
が含まれます。
構文
string = object.hash; object.hash = string;
例
<a id="myAnchor" href="/en-US/docs/HTMLHyperlinkElementUtils.href#Examples">Examples</a>
<script>
var anchor = document.getElementById("myAnchor");
console.log(anchor.hash); // 戻り値は '#Examples'
</script>
仕様
仕様 | 状態 | コメント |
---|---|---|
HTML Living Standard HTMLHyperlinkElementUtils.hash の定義 |
現行の標準 | 初期定義 |
ブラウザーの互換性
BCD tables only load in the browser
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-data and send us a pull request.
関連情報
HTMLHyperlinkElementUtils
ミックスインに属します。