O'Reilly logo

jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples by Adriaan de Jonge

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 2. Selecting Elements

This chapter demonstrates how to select elements by using jQuery. It covers CSS selectors, extensions, and functions to further find and filter elements. After selecting elements, you can use additional methods to traverse the document.

Recipe: Combining Two Element Sets by Using add()

Using the standard jQuery selector, you can make a single CSS query. However, in some cases, you might want to perform an operation on a set of elements beyond a single CSS query. When using the add()function, additional selectors can be added. This creates additional selections instead of only modifying the original selector. Listing 2.1 shows how you can combine the results of two CSS queries for use with a single operation.

Listing ...

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