O'Reilly logo

Learning jQuery Third Edition by Karl Swedberg, Jonathan Chaffer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DOM manipulation methods

DOM manipulation methods are discussed in detail in Chapter 5.

Attributes and properties

Manipulation Method

Description

.attr(key)

Get the attribute named key

.attr(key, value)

Set the attribute named key to value

.attr(key, fn)

Set the attribute named key to the result of fn (called separately on each matched element)

.attr(map)

Set attribute values, given as key-value pairs

.removeAttr(key)

Remove the attribute named key

.prop(key)

Get the property named key

.prop(key, value)

Set the property named key to value

.prop(key, fn)

Set the property named key to the result of fn (called separately on each matched element)

.prop(map)

Set property values, given as key-value ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required