Changing Class Names

Changing class names using the DOM requires that IE uses setAttribute("className","newrule") and Moz uses setAttribute("class","newrule"), where newrule is the name of the rule to be assigned.

The Cross-Browser method is to use document.getElementById("id").className="rule"

IE requires

setAttribute("className","rule2")

while Moz requires

setAttribute("class","rule2")


Works in Moz Swap Rule

Works in IE Swap Rule

Works in both Swap Rule