DOM: className in Internet Explorer [Update]
Just a note for me, because I'm always taken in by this:
document.getElementById("myElement").setAttribute("class","myClass"); //will not work in IE
document.getElementById("myElement").className="myClass"; //will work in IE, too.
Update: Found a fault and corrected it. See comments.
Embassies
-
document.getElementById("myElement".setAttribute("class","myClass"
denn das Attribute, welches gesetzt wird heißt ja "class". -
*argh*
Ja, ne, is klar.
Hab es korrigiert.
Trotzdem sollte man im IE wohl besser direkt .className verwenden.
Ciao
Phil -
Your page has an XML parsing error, you missing the semi-colon on a character entity:
XML Parsing Error: not well-formed
Location: http://geeks-have-feelings-too.net/dom-classname-in-internet-explorer/
Line Number 125, Column 78: document.getElementById("myElement".setAttribute("class","myClass"denn das Attribute, welches gesetzt wird hei&sz
-------------------------------------------------------------------------------------------------------------------------------------^
Comment entry
Commenting isn't available anymore.
Trackback(s)
A trackback is a kind of a source link. If i was finding an interesting entry in another blog, that i am commenting in my own blog, i am linking to the original message via the trackback. Has someone commented one of my entries in his/her weblog, you can find this link here under trackbacks, too. More informations about trackback are in the Wikipedia for example.
Trackback URL: /trackback/dom-classname-in-internet-explorer/