Skip to content
tobiasz.cudnik edited this page Sep 24, 2008 · 7 revisions

Table of Contents

Example

Table of Contents

 * [#Attr Attr]
 * [#Class Class]
 * [#HTML HTML]
 * [#Text Text]
 * [#Value Value]

Attr

 * *[http://docs.jquery.com/Attributes/attr attr]*[http://docs.jquery.com/Attributes/attr ($name)] Access a property on the first matched element. This method makes it easy to retrieve a property value from the first matched element. If the element does not have an attribute with such a name, undefined is returned.
 * *[http://docs.jquery.com/Attributes/attr attr]*[http://docs.jquery.com/Attributes/attr ($properties)] Set a key/value object as properties to all matched elements.
 * *[http://docs.jquery.com/Attributes/attr attr]*[http://docs.jquery.com/Attributes/attr ($key, $value)] Set a single property to a value, on all matched elements.
 * *[http://docs.jquery.com/Attributes/attr attr]*[http://docs.jquery.com/Attributes/attr ($key, $fn)] Set a single property to a computed value, on all matched elements.
 * *[http://docs.jquery.com/Attributes/removeAttr removeAttr]*[http://docs.jquery.com/Attributes/removeAttr ($name)] Remove an attribute from each of the matched elements.

Class

 * *[http://docs.jquery.com/Attributes/addClass addClass]*[http://docs.jquery.com/Attributes/addClass ($class)] Adds the specified class(es) to each of the set of matched elements.
 * *[http://docs.jquery.com/Attributes/hasClass hasClass]*[http://docs.jquery.com/Attributes/hasClass ($class)] Returns true if the specified class is present on at least one of the set of matched elements.
 * *[http://docs.jquery.com/Attributes/removeClass removeClass]*[http://docs.jquery.com/Attributes/removeClass ($class)] Removes all or the specified class(es) from the set of matched elements.
 * *[http://docs.jquery.com/Attributes/toggleClass toggleClass]*[http://docs.jquery.com/Attributes/toggleClass ($class)] Adds the specified class if it is not present, removes the specified class if it is present.

HTML

 * *[http://docs.jquery.com/Attributes/html html]*[http://docs.jquery.com/Attributes/html ()] Get the html contents (innerHTML) of the first matched element. This property is not available on XML documents (although it will work for XHTML documents).
 * *[http://docs.jquery.com/Attributes/html html]*[http://docs.jquery.com/Attributes/html ($val)] Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).

Text

 * *[http://docs.jquery.com/Attributes/text text]*[http://docs.jquery.com/Attributes/text ()] Get the combined text contents of all matched elements.
 * *[http://docs.jquery.com/Attributes/text text]*[http://docs.jquery.com/Attributes/text ($val)] Set the text contents of all matched elements.

Value

 * *[http://docs.jquery.com/Attributes/val val]*[http://docs.jquery.com/Attributes/val ()] Get the content of the value attribute of the first matched element.
 * *[http://docs.jquery.com/Attributes/val val]*[http://docs.jquery.com/Attributes/val ($val)] Set the value attribute of every matched element.
 * *[http://docs.jquery.com/Attributes/val val]*[http://docs.jquery.com/Attributes/val ($val)] Checks, or selects, all the radio buttons, checkboxes, and select options that match the set of values.

Read more at Attributes section on jQuery Documentation Site.

Clone this wiki locally