HTMLLinkElement: relList プロパティ
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.
HTMLLinkElement.relList
は読み取り専用プロパティで、rel
属性を反映します。 これは生きた DOMTokenList
で、<link>
要素で表されるリソースと現在のドキュメントの間の関係を示すリンク種別のセットが入ります。
このプロパティ自体は読み取り専用です。つまり、DOMTokenList
を別のものに置き換えることはできませんが、その内容は変更できます。
値
生きた DOMTokenList
です。
例
js
const links = document.getElementsByTagName("link");
const length = links.length;
for (const link of links) {
const listLength = list.length;
console.log("New link found.");
relList.forEach((relEntry) => {
console.log(relEntry);
});
}
仕様書
Specification |
---|
HTML # dom-link-rellist |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
relList |
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.
関連情報
<a>
および<area>
の同等のプロパティであるHTMLAnchorElement.relList
およびHTMLAreaElement.relList
- まったく同じリストを文字列の空白区切りトークンとして扱うもの:
HTMLLinkElement.rel