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.

nameHTMLMapElement インターフェイスのプロパティで、<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 GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
name

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報