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 July 2015.
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 |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.
関連情報
HTMLImageElement.useMap
プロパティHTMLAreaElement
要素