jQuery
New Wave Javascript


This code is part of the the jQuery Base module.

Style Methods

css(Key,Value)

Sets the 'Key' style parameter of every element to 'Value'. Similar to doing: element.style.Key = Value;

Example:

$("p").css("font","14px Arial");

css(Hash)

Takes a hash of Key/Value pairs and runs css(Key,Value) on every matched element.

Example:

$("p").css({
  font:"14px Arial",
  border:"1px solid #000"
});

addClass(String)

Adds the class to every matched element. Will not add the class if the class already exists on an element.

Example:

$("p:even").addClass("even");

removeClass(String)

Removes the class on every matched element. Will not fail if the class does not exist.

Example:

$("p").removeClass("even");