javascript to set class name

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
rajsekar2u
Forum Commoner
Posts: 71
Joined: Thu Nov 20, 2008 4:23 am

javascript to set class name

Post 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
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: javascript to set class name

Post by kaszu »

.className works in all browsers

Code: Select all

document.getElementById("dropicon").className = "downimg";
rajsekar2u
Forum Commoner
Posts: 71
Joined: Thu Nov 20, 2008 4:23 am

Re: javascript to set class name

Post by rajsekar2u »

thanx. it works
Post Reply