Common Methods of the jQuery Node

By Andy Harris

Part of JavaScript & AJAX For Dummies Cheat Sheet

The jQuery library turns DOM objects into powerful jQuery nodes. The following table shows a few of the more commonly used methods of the jQuery node.

Method Description
addClass(), removeClass(),
toggleClass()
Applies or removes a CSS class to a jQuery node.
css("attribute",
"value")
Applies a single CSS rule to the jQuery node.
Css(JSONObject) Applies JSON object list of CSS rules and values to the jQuery
node.
html() Reads or changes the HTML contents of the jQuery node.
text() Reads or changes the text contents of a jQuery node.
val() Reads the value of a form element.
bind(event, function) Triggers function to occur when event occurs.
Show(), hide(), toggle() Makes element appear or disappear.
animate(parameters, duration) parameters is a JSON object
consisting of CSS rules and values. Values are smoothly changed
from current value to target value over duration (measured in
milliseconds).