The DOM manipulation methods are discussed in detail in Chapter 5, Manipulating the DOM.
DOM manipulation methods
Attributes and properties
Manipulation method |
Description |
.attr(key) |
Gets the attribute named key. |
.attr(key, value) |
Sets the attribute named key to value. |
.attr(key, fn) |
Sets the attribute named key to the result of fn (called separately on each matched element). |
.attr(obj) |
Sets attribute values given as key-value pairs. |
.removeAttr(key) |
Removes the attribute named key. |
.prop(key) |
Gets the property named key. |
.prop(key, value) |
Sets the property named key to value. |
.prop(key, fn) |
Sets the property named key to the result of fn (called separately on each matched element). |
.prop(obj) |
Sets property... |