HTMLMapElement: name プロパティ
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
name は HTMLMapElement インターフェイスのプロパティで、<map> 要素の一意な名前を表します。
この値は <img> 要素の useMap 属性と一緒に使うことで、<map> 要素を参照することができます。
<map> 要素に id 属性が設定されている場合、この name プロパティはこの id と同じになります。
値
ホワイトスペースのない、空でない文字列です。
例
html
<map name="image-map">
<area shape="circle" coords="15,15,5" />
</map>
js
const mapElement = document.getElementsByName("image-map")[0];
console.log(mapElement.name); // 出力: "image-map"
仕様書
| Specification |
|---|
| HTML> # dom-map-name> |
ブラウザーの互換性
Loading…
関連情報
HTMLImageElement.useMapプロパティHTMLAreaElement要素