Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

class vs className 1

Status
Not open for further replies.

mcowen

Programmer
Joined
Oct 21, 2001
Messages
134
Location
GB
Hi,

I'm trying to assign a class to a dynamically added span field. In IE it needs
span.setAttribute("className","mycssclass")
but in Mozilla it needs
span.setAttribute("class","mycssclass").

Anyone else find this a little annoying? I realise you can do
element.className in Mozilla and do a browser test but its still a pain.

Any advice welcome.

Matt
"<italic>Success is 10% inspiration, 90% last minute changes</italic>
 

[tt]element.className = 'className';[/tt] works fine in nearly all browsers.

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top