O'Reilly logo

jQuery Essentials by Troy Miles

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. jQuery Selectors and Filters

The name "jQuery" comes from the library's ability to quickly and intelligently query the DOM (Document Object Model).

In this chapter, we will learn how to query the DOM ourselves and, once we have a set of items, how to use filters to further refine our dataset. We will cover the following topics:

  • What selectors and filters are
  • How to create a selector
  • How to create a filter
  • How to query based on element attributes
  • How chaining allows us to quickly and neatly continue queries

jQuery selectors

Underneath every browser web page is the DOM. The DOM keeps track of all the individual objects that are rendered to the page. Being able to find DOM elements is the first step toward creating a dynamic web page. The browser ...

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