HTMLAreaElement: hash ããããã£
Baseline
åºãå©ç¨å¯è½
ãã®æ©è½ã¯åºãå®è£ ããã¦ãããå¤ãã®ãã¼ã¸ã§ã³ã®ç«¯æ«ããã©ã¦ã¶ã¼ã§åä½ãã¾ãã2015å¹´7æä»¥éããã¹ã¦ã®ãã©ã¦ã¶ã¼ã§å©ç¨å¯è½ã§ãã
hash 㯠HTMLAreaElement ã¤ã³ã¿ã¼ãã§ã¤ã¹ã®ããããã£ã§ããã® <area> è¦ç´ ã® href ã«ãããã "#" ã«ç¶ããã©ã°ã¡ã³ãèå¥åã®æååãè¿ãã¾ãã URL ã«ãã©ã°ã¡ã³ãèå¥åããªãå ´åããã®ããããã£ã«ã¯ç©ºã®æåå "" ãå
¥ãã¾ãã
詳ãã㯠URL.hash ãåç
§ãã¦ãã ããã
å¤
æååã§ãã
ä¾
>ã¨ãªã¢ã®ãªã³ã¯ããããã·ã¥ãåå¾
ãã® HTML ããã£ãã¨ãã¾ãã
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" />
ãã®ããã«ããã¨ãã¢ã³ã«ã¼ã®ããã·ã¥ãåå¾ãããã¨ãã§ãã¾ãã
js
const area = document.getElementById("mdn-circle");
area.hash; // '#ExampleSection'
仿§æ¸
| 仿§æ¸ |
|---|
| HTML > # dom-hyperlink-hash-dev > |
ãã©ã¦ã¶ã¼ã®äºææ§
é¢é£æ å ±
- æå±å
ã®
HTMLAreaElementã¤ã³ã¿ã¼ãã§ã¤ã¹