This code is part of the the jQuery Base? module.
Style Methods
css(Key,Value)
Description
Sets the 'Key' style parameter of every element to 'Value'. Similar to doing: element.style.Key = Value;
Examples
$("p").css("font","14px Arial");
css(Hash)
Description
Takes a hash of key/value pairs and runs css(Key,Value) on every matched element.
Examples
$("p").css({
font:"14px Arial",
border:"1px solid #000"
});
addClass(String)
Description
Adds the class to every matched element. Will not add the class if the class already exists on an element.
Note that this function *adds* the class to existing classes on the object. To replace existing classes use either option below:
$("foo").set( "className", "new classes" );
OR $("foo").removeClass().addClass("new class");
Examples
$("p:even").addClass("even");
removeClass(String)
Description
Removes the class on every matched element. Will not fail if the class does not exist.
Passing no parameter removes all classes from the object.
Examples
$("p").removeClass("even");
$("p").removeClass();