About Me

My photo
Talk to me... you will know
Showing posts with label jQuery. Show all posts
Showing posts with label jQuery. Show all posts

Monday, September 12, 2011

jQuery Basics


A-> Attribute
B-> Element
C-> Element
D-> Class
I-> Id
V-> Value


Selector Description
-------------------------------------------------------------------------------------
* Matches any element


B Matches all element with tag name B


B C Matches all element with tag name C that are descendants of B


B>C Matches all C that are direct children of B


B+C Match all C immediately preceded by sibling 
B


B~C Match all C preceded by any B


B:has(C) Match all B that has at least 1 descendant C


B.D Match all B with class D


.D Match all class D.             (*.D)


B#I Match all B with id I


#I Match all id I         (*#I)


B[A] Match all B with attribute A of any value


B[A=V] Match all B with attribute A  and value V


B[A^=V] Match all B with attribute A and value beginning with V


B[A$=V] Match all B with attribute A and value ending with V


B[A*=V] Match all B with attribute A and value containing V
..........................................................................................
:first First match of the page


:last Last match of the page


:first-child First child element


:last-child Last child element


:only-child All element without siblings


:nth-child(n) nth child element


:nth-child(even|odd) Even or odd children


:nth-child(Xn+Y) Element computed by the supplied formula


:even|:odd Even|Odd matching elements page wide


:eq(n) nth matching element


:gt(n) matching elements after n and excluding the 
nth


:lt(n) matching elements before n and excluding the nth
-----------------------------------------------------------------------------------------