JQuery filters fall in to six different categories.
- Basic filters
- Content filters
- Visibility filters
- Attribute filters
- Child filters
- Form filters
In this post I'm going to discuss about Basic JQuery filters. It provides basic filtering like getting first, last and even and odd numbered items in a returned set.
A List of usage of JQuery filters.
| Filter | Purpose |
|---|---|
| :first | selects only the first instance of the selector's returned set |
| :last | selects only the last instance of the selector's returned set |
| :even | selects only even numbered elements of the selector's returned set |
| :odd | selects only odd numbered elements of the selector's returned set |
| :eq(n) | filters out elements that are positioned at the given index |
| :gt(n) | include elements that are past the given index |
| :lt(n) | include elements that are before the given index |
| :header | select all header elements (H1, H2, H3 etc) |
| :animated | selects all elements that are currently being animated in some way |
| :not(selector) | includes elements that do not match the given selector |
This is just a list of what can be done with JQuery filters.
Please refer this post for practical examples of usage of JQuery basic selectors.

No comments:
Post a Comment