O'Reilly logo

Pro jQuery 2.0, Second Edition by Adam Freeman

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

CHAPTER 8

image

Manipulating Elements

In this chapter, I show you how to use jQuery manipulate elements, including how to get and set attributes, how to use the jQuery convenience methods for working with classes and CSS properties, and how to get and set HTML and text content. I also show you a nice feature that allows you to associate data with elements. Table 8-1 provides the summary for this chapter.

Table 8-1. Chapter Summary

Problem Solution Listing
Get the value of an attribute from the first element in a jQuery object Use the attr method 1
Get the value of an attribute from every element in a jQuery object Use the each and

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