DOM method issue in Firefox

The following code is working fine in IE but not in Firefox.

var col1 = parent.document.getElementsByTagName(“LI”);
col1[‘ulitem0_0’].className = “inactivetab”;

In firefox, I am getting error ‘col1.ulitem0_0 is undefined’. How do I resolve this error ?

Hi,

This is a JS question and not a CSS issue :slight_smile:

JS isn’t my strongpoint but as I understand it col1 returns a collection of all the List elements inside your page. To access an individual element you would need to set the appropriate value.

e.g.
col1[0].className = “inactivetab”;

If you have a variable previously defined for this purpose (perhaps ulitem0_0) then you would need to use that instead but without the quotes.

col1[ulitem0_0].className = “inactivetab”;

Unless you have other css issues I will move the thread to the js forum for a better answer. :slight_smile: