DocumentOrShadowRoot.styleSheets
Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。
DocumentOrShadowRoot
インターフェイスの styleSheets
読み取り専用プロパティは、 CSSStyleSheet
オブジェクトの StyleSheetList
を返します。ドキュメントに明示的にリンクまたは埋め込まれたスタイルシートの場合。
例
function getStyleSheet(unique_title) {
for (var i=0; i<document.styleSheets.length; i++) {
var sheet = document.styleSheets[i];
if (sheet.title == unique_title) {
return sheet;
}
}
}
Notes
仕様
仕様 | ステータス | 備考 |
---|---|---|
Shadow DOM DocumentOrShadowRoot の定義 |
廃止 | 初回定義 |
ブラウザー実装状況
No compatibility data found for api.DocumentOrShadowRoot.styleSheets
.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.