A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/ja/docs/Web/API/HTMLAreaElement/hash below:

HTMLAreaElement: hash プãƒãƒ‘ティ - Web API

HTMLAreaElement: hash プロパティ

Baseline Widely available

hash は HTMLAreaElement インターフェイスのプロパティで、この <area> 要素の href における、 "#" に続くフラグメント識別子の文字列を返します。 URL にフラグメント識別子がない場合、このプロパティには空の文字列 "" が入ります。

詳しくは URL.hash を参照してください。

値

文字列です。

例 エリアのリンクからハッシュを取得

この HTML があったとします。

<map name="infographic">
  <area
    id="mdn-circle"
    shape="circle"
    coords="130,136,60"
    href="https://developer.mozilla.org/#ExampleSection"
    alt="MDN" />
</map>

<img
  usemap="#infographic"
  src="/media/examples/mdn-info.png"
  alt="MDN infographic" />

このようにすると、アンカーのハッシュを取得することができます。

const area = document.getElementById("mdn-circle");
area.hash; // '#ExampleSection'
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4