W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2000

RE: setAttribute

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Mon, 18 Dec 2000 08:56:27 -0500
To: Rob Relyea <rrelyea@microsoft.com>
Cc: "'Peter Benoit'" <pbenoit@triton-network.com>, www-dom@w3.org
Message-ID: <OF3ECF7014.849A0E92-ON852569B9.004BCBDA@pok.ibm.com>

>We can consider fixing this in the future, however, most web authors
>probably want to use divEl.className until then since it has worked since
>IE4 and also works in Nav6.

That syntax should continue to work. That's the correct Javascript binding
for the "className" IDL attribute which is used to manipulate the "class"
HTML attribute.  Similarly,
     divEl.setClassName("bar");
should work in Java, since that's the corresponding binding.


However:
     //this works in nav6 but not ie
     divEl.setAttribute("class","bar");
_should_ work, since that's the correct syntax for accessing the "class"
HTML attribute via the setAttribute operation, and
     //this works in ie but not nav6
     divEl.setAttribute("className","bar");
should set the "className" HTML attribute rather than "class"... in other
words, it should "work" but it does exactly what you told it to do, rather
than what you intended it to do.


I don't think there's any doubt about the DOM's intent in this regard.
There may be some fuzziness in the wording. Is a FAQ entry needed?

______________________________________
Joe Kesselman  / IBM Research
Received on Monday, 18 December 2000 08:57:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT