className

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron Gray

    className

    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.


  • Aaron Gray

    #2
    Re: className

    "Aaron Gray" <ang.usenet@gma il.comwrote in message
    news:6dt052F407 6cU1@mid.indivi dual.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


    Comment

    • Richard Cornford

      #3
      Re: className

      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.

      Comment

      • webbugtrack@gmail.com

        #4
        Re: className

        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:
        Issue: #242 Affects: IE5, IE5.5, IE6, IE7 MSIE Feedback ID(s): 332453 (events) 332237 (type) 336253 (object, not a string) 336256 (cellpa...


        Regards,
        Max

        Comment

        Working...