Page 1 of 1

javascript to set class name

Posted: Mon Jun 22, 2009 3:56 am
by rajsekar2u
Hi,
Am using the following javascript to set class name.

Code: Select all

document.getElementById("dropicon").setAttribute("class", "downimg");
Its working in firefox well.
But its not working in IE6.

Is there ant equivalent script which runs in IE6

Re: javascript to set class name

Posted: Tue Jun 23, 2009 5:27 am
by kaszu
.className works in all browsers

Code: Select all

document.getElementById("dropicon").className = "downimg";

Re: javascript to set class name

Posted: Mon Jun 29, 2009 2:41 am
by rajsekar2u
thanx. it works