Making CSS1 Work in W3C DOM 2

3. Define a convenience function to add a rule to the style sheet

function addRuleToStyleElement 
   (styleSheetElement, selector, declaration)
{  styleSheetElement.insertRule (selector + 
   " { " + declaration + " } ",
   styleSheetElement.cssRules.length); 
   // insert at end of sheet
}

Speaker Notes