[thelist] Re: Finding class

Andrew Clover and at doxdesk.com
Tue Jan 29 13:18:00 CST 2002


Ben Gustafson <Ben_Gustafson at lionbridge.com> wrote:

> getElementsByTagName may work in newer versions of IE (I haven't checked),

Yes, IE5+.

> but you're probably safer with var x = document.all.tags("TD") for including
> older versions.

This can indeed be used as a backup for IE4.

> For Netscape 6.x and Opera, use getAttribute('class')=="td_text" instead
> of className == "td_text".

Actually 'className' is valid DOM Level 1 HTML. I don't know why Opera
does not support it, but I've just submitted it as a bug.

Unfortunately, getAttribute('class') doesn't work in IE/Win (certainly
5.5, probably other versions). Neither does getAttribute('for') on label
objects. This is a really annoying bug to do with reserved words in JScript.

So looks like you'll need both if you need to support IE *and* Opera. :-(

--
Andrew Clover
mailto:and at doxdesk.com
http://and.doxdesk.com/



More information about the thelist mailing list