I tried something like this:

document.getElementById("spanID").setAttribute("class", "testClass");

Works in Firefox, but does not work in IE (both 6 and 7). Anyone know of any workaround?