addClass is exactly what it says, it adds a class. Predefine the class
in your CSS pages with the attributes you require and use the addClass
function to add it to your target.".addClass('newclass');"  You can
also use removeClass to remove the class ".removeClass('newclass');"

If you want to define the CSS in the Jscript, then use the .css
function using an array of styles ".css({'background-color':'red',
'color':'white'});" I find that it is easier to keep track of the CSS
if you keep it in the CSS pages, just make a comment in the file so
you know what the class is for.



On Dec 6, 5:50 pm, "Dirceu Barquette" <[EMAIL PROTECTED]>
wrote:
> Hi!
>
> How can I add a class with its attrs dynamically?
>
> like this (not works, obvious ...)---> $('#div').addClass('blah
> {background:"#000"}')
>
> Thanks,
>
> Dirceu Barquette

Reply via email to