HTMLAreaElement: target 屬性
HTMLAreaElement 介面的 target 屬性是一個字串,用於指定連結資源的顯示位置。
它反映了 <area> 元素的 target 屬性。
值
表示目標(target)的字串。其值可以是
<frame>的名稱。- 其中一個 具有特定值的關鍵字:
_blank、_self、_parent或_top。
示例
html
<map name="image-map">
<area href="www.example.com" target="_top" alt="left" />
</map>
js
const areaElement = document.getElementsByName("image-map")[0].areas[0];
console.log(areaElement.target); // Output: "_top"
規範
| 規範 |
|---|
| HTML # dom-area-target |
瀏覽器相容性
載入中…