Note : The Rules collection is Internet Explorer 4.0 specific. As Netscape doesn't support dynamic style sheets, it doesn't support the Rules collection.
The Rules collection returns an indexed array of all the style rules in a referenced StyleSheet object. These are the style declarations for elements, classes, ids etc., set in the style sheet. The Rules collection is populated with references to style sheet rules regardless of whether or not the referenced style sheet is disabled, although any scripting changes to the rules will only become visible if the referenced style sheet is enabled. Any style sheets linked via the
@import method will have their rules expanded in-place inside the rules collection.
Note that individual rules can only be added to a rules collection, by using the
addRule method of the StyleSheet object.
length property returns the number of rules in the collection. Note that the
length count starts at 1, not 0 as the rules collection index does. Therefore, the
length property may return a value of 5, but to access the 3rd rule, you'd need to use
© 1995-1998, Stephen Le Hunte
|file: /Techref/language/html/ib/Scripting_Reference/rulcol.htm, 2KB, , updated: 2004/3/1 16:47, local time: 2019/7/23 21:35,
|©2019 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.sxlist.com/techref/language/html/ib/Scripting_Reference/rulcol.htm"> The Rules collection</A>
|Did you find what you needed?|
Welcome to sxlist.com!
& kind contributors
just like you!
Please don't rip/copy
Copies of the site on CD
are available at minimal cost.
Welcome to www.sxlist.com!