Hey friends, I would like to share all the small/big things i have learned during my experience. If you find this blog helpful, please leave your comments

Wednesday, June 10, 2009

jQuery selectors are one of the most important aspects of the jQuery library. These selectors use familiar CSS syntax to allow page authors to quickly and easily identify any set of page elements to operate upon with the jQuery library methods. Understanding jQuery selectors is the key to using the jQuery library most effectively. This reference card puts the power of jQuery selectors at your very fingertips.

Selector: parent > child > childExample: $("p > b")Description: Matches all immediate children of an element or selector expression that match the right element/selector.

Selector: prev ~ siblings ~ siblingsExample: $("#row_11:nth-child(2)~td")$("~td")Description: Matches the next siblings at the sample level as the preceeding expression. Example, matches 3-nth columns of a table row. Best used as a find() or filter() against an existing jQuery instance.

Selector: prev + nextsibling + nextsiblingExample: $("#tdMoneyCol+td")$("+td")Description: Matches the following sibling. Works best with find() or filter() against an existing jQuery object.

Selector: filterExample: $("input:button")Description: applies filters to the query. jQuery support CSS 3 filters plus a number of custom filters.Examples: :not,:button,:visible,:hidden,:checked,:first,nth-child(1),:has,:is,:contains,:parent