By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,568 Members | 1,196 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,568 IT Pros & Developers. It's quick & easy.

className

P: n/a
Okay, onto className and the HTML class attribute.

When was className introduced, I believe it was introduced by Microsoft,
although I could be wrong. Now I also believe that Mozilla added support for
'className' at some point in Geko's life time, but when ?

Now the really horribly funny thing is when using getAttribute() and friends
IE only works with 'className' where as FF only works with 'class'. Funny
funny behaviour, I don't say.

Anyone educate me thurther with some details ?

Many thanks in advance,

Aaron

P.S. I could not find anything in the FAQ or any other good standard
informative source, but I maybe wrong.
Jul 13 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Aaron Gray" <an********@gmail.comwrote in message
news:6d************@mid.individual.net...
Okay, onto className and the HTML class attribute.

When was className introduced, I believe it was introduced by Microsoft,
although I could be wrong. Now I also believe that Mozilla added support
for 'className' at some point in Geko's life time, but when ?
Woopse its a W3C DOM construct !
Anyone educate me thurther with some details ?
Anyone know with which browsers Geko and IE introduced it ?

I am wondering if we have to use get/setAttribute() with older browsers at
all ?

Does the behaviour need lifting, or can we just use the className object
attribute for all baseline browsers ? By baseline I mean all browsers
supporting Javascript 1.5/ ECMAScript 3/ JScript 5.5 ?

Aaron
Jul 13 '08 #2

P: n/a
Aaron Gray wrote:
Okay, onto className and the HTML class attribute.

When was className introduced, I believe it was introduced by
Microsoft, although I could be wrong.
IE 4 had calssName properties on its elements, Netscape 4 did not. I
have never seen and IE 3 in the flesh so I don't know anything about its
object model (and couldn't care less at this point).
Now I also believe that Mozilla added support for 'className' at some
point in Geko's life time, but when ?
Pre-release Mozzlia browsers had className properties on its elements
(including at least 0.9 to my certain knowledge), as did Netscape 6
browsers. (there were no Netscape 5 browsers)

<snip>
P.S. I could not find anything in the FAQ or any other good
standard informative source, but I maybe wrong.
The HTML DOM is the only standard relevant to className properties.

Richard.

Jul 13 '08 #3

P: n/a
Until IE8 (in Beta) IE will not handle getting/setting the class
attribute using the DOM methods getAttribute() and setAttribute().

Then again, 'class' is merely one of dozens of attributes that fail to
work properly in IE.

Check the known issues with setting (and getting) IE attributes here:
http://webbugtrack.blogspot.com/2007...ways-work.html

Regards,
Max
Jul 15 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.