CD-569Appendix F . Examples from Parts III and (Yahoo web hosting)
CD-569Appendix F . Examples from Parts III and IV Next, examine the properties of one of the rules by entering the following statement into the bottom text box: document.styleSheets[0].rules[1] You now see the all the properties that IE4+ exposes for a rule object. Methods addRule( selector , styleSpec [, index]) removeRule(index) NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example Use The Evaluator (Chapter 13) with IE4+ to add a style sheet rule to the first styleSheet object of the page. First, make sure the style sheet is enabled by entering the following statement into the top text box: document.styleSheets[0].disabled = false Next, append a style that sets the color of the TEXTAREA element: document.styleSheets[0].addRule( TEXTAREA , color:red ) Enter any valid object (such as document.body) into the bottom text box to see how the style has been applied to the TEXTAREA element on the page. Now remove the style, using the index of the last item of the rulescollection as the index: document.styleSheets[0].removeRule(document.styleSheets[0].rules.length - 1) The text in the TEXTAREA returns to its default color. styleSheetObject.addRule()
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.