cssRules, CSSRuleList, rules | NN 6 IE 4 DOM 2 |
A collection of cssRule (Netscape 6 and IE 5/Mac) or rule (IE 4 and later) objects that are members of a styleSheet object. The W3C DOM abstract representation of this collection is called a CSSRuleList object. Members of this collection are accessed only via their integer index number, but you may iterate through the collection and examine properties of each rule object (such as the selectorText property) to distinguish one rule from another. |
|
Object Model Reference | |
|
|
Object-Specific Properties | |
|
|
Object-Specific Methods | |
|
|
Object-Specific Event Handler Properties | |
None. |
length | NN 6 IE 4 DOM 2 |
Read-only | |
Returns the number of elements in the collection, including @ rules. |
|
Example | |
var howMany = document.styleSheets[1].cssRules.length; |
|
Value | |
Integer. |
item( ) | NN 6 IE 4 DOM 2 |
item(index) | |
Returns a style sheet rule object corresponding to the rule matching the index value in source code order. |
|
Parameters | |
|
|
Returned Value | |
Reference to a cssRule or rule object, depending on the object model. If there are no matches to the parameters, the returned value is null. |