Class |
.addClass( className ) |
jQuery |
- |
Adds the specified class(es) to each of the set of matched elements. |
Class |
.addClass( function(index, class) ) |
jQuery |
- |
New 1.4 Adds the specified class(es) to each of the set of matched elements. |
Attr |
.attr( attributeName ) |
String |
.attr( attributeName ) |
Get the value of an attribute for the first element in the set of matched elements. Attributes include title, alt, src, href, width, style, etc. |
Attr |
.attr( attributeName, value ) |
jQuery |
.attr( attributeName, value ) |
Set one or more attributes for the set of matched elements. |
Attr |
.attr( map ) |
jQuery |
.attr( map ) |
Set one or more attributes for the set of matched elements. |
Attr |
.attr( attributeName, function(index, attr) ) |
jQuery |
.attr( attributeName, function(index, attr) ) |
Set one or more attributes for the set of matched elements. |
Class |
hasClass( class ) |
Boolean |
.hasClass( className ) |
Determine whether any of the matched elements are assigned the given class. |
HTML |
html( ) |
String |
.html() |
Get the HTML contents of the first element in the set of matched elements. This method is not available on XML documents. |
HTML |
html( htmlString ) |
jQuery |
.html( htmlString ) |
Set the HTML contents of each element in the set of matched elements. This method is not available on XML documents. |
HTML |
html( function(index, html) ) |
jQuery |
.html( function(index, html) ) |
New 1.4 Set the HTML contents of each element in the set of matched elements. This method is not available on XML documents. |
Attr |
removeAttr( name ) |
jQuery |
.removeAttr( attributeName ) |
Remove an attribute from each element in the set of matched elements. |
Class |
removeClass( [ className ] ) |
jQuery |
.removeClass( [ className ] ) |
Removes all or the specified class(es) from the set of matched elements .This method is not available on XML documents. |
Class |
removeClass( function(index, class) ) |
jQuery |
- |
New 1.4 Removes all or the specified class(es) from the set of matched elements .This method is not available on XML documents. |
Text |
text( ) |
String |
- |
Get the combined text contents of each element in the set of matched elements, including their descendants. |
Text |
text( val ) |
jQuery |
- |
Set the content of each element in the set of matched elements to the specified text. |
Text |
text( val ) |
jQuery |
- |
New 1.4 Set the content of each element in the set of matched elements to the specified text. |
Class |
toggleClass( className ) |
jQuery |
.toggleClass( className ) |
Add or remove a class from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. |
Class |
toggleClass( className, switch ) |
jQuery |
.toggleClass( className, switch ) |
Add or remove a class from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. |
Class |
toggleClass( function(index, class), [ switch ] ) |
jQuery |
.toggleClass( function(index, class), [ switch ] ) |
New 1.4 Add or remove a class from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. |
Value |
val() |
String, Array |
.val() |
Get the current value of the first element in the set of matched elements. |
Value |
val( value ) |
jQuery |
.val( value ) |
Set the value of each element in the set of matched elements. |
Value |
val( function ) |
jQuery |
.val( function ) |
Set the value of each element in the set of matched elements. |