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

Creating basic filter selectors

Filters take the results of a selector call and whittle it down some more. There are three types of filter selectors: basic, child, and content. Basic selectors just operate on the jQuery object result set. Child selectors operate on the parent-child relation between elements. And the content filters work on the contents of each of the elements of the result set.

There are 14 basic filter selectors. The first group deals with the position of a result in the result set. Let's deal with them first.

One of the easiest to understand is the :eq() filter selector. It retrieves the result when the index number is passed. It is very much like accessing an element in a JavaScript array. And like an array, it is zero-based, ...

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