jQuery TraversingLesson 25Free preview
jQuery Filtering
This lesson is part of jQuery · All levels
Summary
Filtering is used to filter selection results so that only certain elements are processed. Methods such as first(), last(), eq(n), filter(), and not() narrow down the selection from the existing set. With filtering you can take the first item, the numbered item, or just the one that qualifies without writing a new selector.
Key points
- First() and last() take the first and last elements of the selection results
- Eq(n) takes the element based on the index number starting from zero
- Filters elements that match the selector or function
- Excludes elements that match the selector
- Checks whether selection produces a particular element
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.