CSSRuleList: length property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{ APIRef("CSSOM") }}
The **length** property of the {{domxref("CSSRuleList")}} interface returns the number of {{domxref("CSSRule")}} objects in the list.
Value
An integer.
Examples
In the following example the number of items in the {{domxref("CSSRuleList")}} named myRules is printed to the console.
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules.length);Specifications
{{Specifications}}
Browser compatibility
{{Compat}}