Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
cssRules は CSSStyleSheet の読み取り専用プロパティで、スタイルシートを構成するすべての CSS ルールについて、リアルタイムで最新のリストを提供する生きた CSSRuleList を返します。リストの各項目は、単一のルールを定義する CSSRule です。
ライブで更新される CSSRuleList で、スタイルシートを構成するすべての CSS ルールを含みます。ルールリストのそれぞれの項目は、スタイルシートを構成する単一のルールを記述する CSSRule オブジェクトです。
スタイルシートの中のそれぞれのルールは、添字でアクセスすることができます。
ルールは for...of を使用してアクセスすることもできます。
しかし、 CSSRule は厳密には配列ではないので、 forEach() を使用することはできません。
| CSS Object Model (CSSOM) # dom-cssstylesheet-cssrules |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023年6月1日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.