Document: styleSheets プロパティ
Baseline
広く利用可能
この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2015年7月以降、すべてのブラウザーで利用可能です。
styleSheets は Document インターフェイスの読み取り専用プロパティで、 CSSStyleSheet オブジェクトの StyleSheetList を返します。これは、この文書に明示的にリンク埋め込まれたスタイルシートを表します。
値
返されるリストは次の順になります。
例
js
function getStyleSheet(unique_title) {
for (const sheet of document.styleSheets) {
if (sheet.title === unique_title) {
return sheet;
}
}
}
仕様書
| 仕様書 |
|---|
| CSS Object Model (CSSOM)> # dom-documentorshadowroot-stylesheets> |