It has an alias `className` in JS because `class` is a reserved word in JS. You should also be able to ask mydiv.style['class']. And, unless you know for sure there is only one class assigned to the div, you need to realize that it might be a space-separated list of classes.

On 2009-06-12, at 14:09EDT, Henry Minsky wrote:

Nevermind, it's 'className', not 'class' ...


On Fri, Jun 12, 2009 at 2:07 PM, Henry Minsky <[email protected]>wrote:

If I have a pointer to a div, what is the right way to ask for it's DOM
class? Can I just say

mydiv.class?

or is it mydiv.style.class?

I'm only seeming to get an error in IE7 when I try either of these

--
Henry Minsky
Software Architect
[email protected]





--
Henry Minsky
Software Architect
[email protected]

Reply via email to