Thanks. That did it. -
On Apr 19, 10:03 am, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] schrieb:
>
> > I discovered that if I want to set the class for an object, this is
> > not the code
>
> > $('#' + id).setAttribute("class", "myClass");
>
> > What is the correct syntax? Tha
[EMAIL PROTECTED] schrieb:
I discovered that if I want to set the class for an object, this is
not the code
$('#' + id).setAttribute("class", "myClass");
What is the correct syntax? Thanks, - Dave
Try this:
$(...).attr("class", "myClass");
If you don't want to replace existing classes,
You can use the addClass and removeClass methods to modify the class
of the element.
$('#'+id).addClass('myClass');
http://jquery.bassistance.de/api-browser/#addClassString
http://jquery.bassistance.de/api-browser/#removeClassString
--
Brandon Aaron
On 4/19/07, [EMAIL PROTECTED] <[EMAIL PROTE
3 matches
Mail list logo