Chapter 2. Selecting Elements

The jQuery library harnesses the power of Cascading Style Sheets (CSS) selectors to let us quickly and easily access elements or groups of elements in Document Object Model (DOM).

In this chapter, we will cover:

  • The structure of the elements on a web page
  • How to use CSS selectors to find elements on the page
  • Custom jQuery extensions to the standard set of CSS selectors
  • The DOM traversal methods, which provide greater flexibility for accessing elements on the page

Understanding the DOM

One of the most powerful aspects of jQuery is its ability to make selecting elements in the DOM easy. The DOM serves as the interface between JavaScript and a web page; it provides a representation of the source HTML as a network of objects ...

Get Learning jQuery - Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.