HTMLAnchorElement: target プロパティ
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.
target
は HTMLAnchorElement
インターフェイスのプロパティで、リンク先のリソースを表示する場所を示す文字列です。
値
対象とするものを表す文字列。その値は次のいずれかになります。
<frame>
の名前。- 次の特定の値によるキーワード、
_blank
,_self
,_parent
,_top
のいずれか。
例
html
<a href="www.example1.com" class="link1" target="_blank">example1</a>
js
const link = document.querySelector(".link1");
console.log(link.target); // output: "_blank"
仕様書
Specification |
---|
HTML # dom-a-target |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
target |
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.
関連情報
HTMLBaseElement.target
プロパティHTMLFormElement.target
プロパティHTMLAreaElement.target
プロパティ