From 05b2650717b84d199f6ebd5df8a8f9d1e3b23f3f Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Tue, 23 Feb 2021 15:56:25 +0100 Subject: sync: move --- files/ja/web/api/htmlanchorelement/hash/index.html | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 files/ja/web/api/htmlanchorelement/hash/index.html (limited to 'files/ja/web/api/htmlanchorelement/hash') diff --git a/files/ja/web/api/htmlanchorelement/hash/index.html b/files/ja/web/api/htmlanchorelement/hash/index.html new file mode 100644 index 0000000000..293b73e2f0 --- /dev/null +++ b/files/ja/web/api/htmlanchorelement/hash/index.html @@ -0,0 +1,60 @@ +--- +title: HTMLHyperlinkElementUtils.hash +slug: Web/API/HTMLHyperlinkElementUtils/hash +tags: + - API + - Experimental + - HTMLHyperlinkElementUtils + - Property + - Reference + - URL API +translation_of: Web/API/HTMLHyperlinkElementUtils/hash +--- +
{{ APIRef("URLUtils") }}
+ +

HTMLHyperlinkElementUtils.hash プロパティは、'#' の後に URL のフラグメント識別子が続く {{domxref("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>
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('HTML WHATWG', '#dom-hyperlink-hash', 'HTMLHyperlinkElementUtils.hash')}}{{Spec2('HTML WHATWG')}}初期定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.HTMLHyperlinkElementUtils.hash")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf