this.changeHighlight = function()
{
var lis = this.div.getElementsByTagName('LI');
for (i in lis)
{
var li = lis[i];
if (this.highlighted == i)
{
li.className = "selected";
//li.setAttribute("className","selected");
}
else
{
li.className = "";
//li.setAttribute("className","");
}
}
};
I tried the above code, which works fine with IE 8. However, this code doesn't work with firefox. Instead of li.className, I tried li.setAttribute, but still it doesn't work.
Help needed please !!!!
Thanks,
Akhil
Last edited by califdon on Thu Jul 16, 2009 12:17 pm, edited 1 time in total.
Reason:Moderator corrected tags to display Javascript code
I am trying to run this on firefox, but it doesnt work. Moreover the above code now doesnt even work on IE.
If I use li.className instead of li.setAttribute, code runs fine on IE, but not on firefox. The code should be able to run on both the browsers, but right now it doesnt do so. Thanks for help in advance.
This what i wrote, but still doesnt work on neither of the browser.
this.changeHighlight = function()
{
var lis = this.div.getElementsByTagName('LI');
//for (i in lis)
for (var i=0, j=lis.length; i<j; i++)
{
//if(lis.hasOwnProperty(i))
{
var li = lis;