On Sep 1, 2:46*pm, Joost Diepenmaat <jo...@zeekat.nlwrote:
bgold12 <bgol...@gmail.comwrites:
Does internet explorer support the statement
elem.setAttribute('style', ... );, for example:
That would be a confusing statement: does it completely replace all
current styles or what? Note that FF (at least FF 2) does not allow
you to replace the style, so elem.style = ... will throw an error.
I disagree. Firefox has support for both forms of *style*
manipulation.
You can change the object's complete style description using the
setAttribute(attrName, attrValue) method. But, for the sake of browser
compatibility what you suggested below is more apt.
You probably want just elem.style.backgroundColor=... and equivalent
instead.
On another note, Firefox has another way of manipulating attributes
which
is a bit daunting. I was so hoping that IE had it. But 6 and 7 don't
support proper attribute manipulation I might say.
document.getElementById(id).attributes.item("style ").nodeValue =
"color:red";
IE8x, I hope would resolve these issues.
Arun