/ Published in: JavaScript
One notorious discrepancy between IE and Firefox (or other "good" browsers) is the way they access the class HTML attribute. While I've used more complicated solutions in the past, this simple solution doesn't require any browser detection or even a function to set the class attribute that is used. Click the URL above for an explanation of how it works (see the comment by "penders").
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
object.className /* Example: */ var someObjectsClass = this.className;
URL: http://www.webmasterworld.com/javascript/3090396.htm