first, the basic selector#Box.box1div$ ("#box, Box1."); second, level selector $ ("Div p");//all the P in the Div$ ("div > P");//Sub-element p in Div$ ("div + P");//the first p at the back of a div$ ("div~p");//all the p behind the Divthree, basic filter selector $ ("P:first");//the first of the P tags$ ("P:last");//last one$ ("P:not (. p)");//Not class= p label for "P"$ ("P:even");//Subscript is even, subscript starting from 0, interlaced color change$ ("p:odd");//Subscript is odd$ ("P:eq (5)");//Subscript = 5 label, eq=equal$ ("P:GT (3)");//Subscript > 3$ ("P:lt (3)");//Subscript < 3$(": Header");//: The header is the abbreviation of H1~H6, matching all the H1~h6iv. content and Visibility selector $ ("P:contains (line)");//Match all P tags that contain line to the P tag content, do a search$ ("P:empty"). HTML ("AAAA");//the content is empty P$ ("P:has (i)");//P label with I label$ ("p:parent");//if P itself is a parent, or if there are child elements$ ("P:hidden"). CSS ("Display", "block");//find the hidden p tag, <p style= "Diplay:none" >line3</p>$ ("p:visible"). CSS ("display", "none");//find the visible p tagv. Attribute selector and child element selector $ ("P[class]");//include attribute class$ ("p[class=p2]");//= equals! = does not equal ^= with what header $= with what end *= contains what$ ("P[CLASS!=P2"));$("p[class][class^=a][class$=2]");//multi-layer filtering$("P:nth-child (2)");//P itself is a second child element$ ("P:first-child");//P itself is the first child element: Last-child:only-childvi. form selector $ ("Form:text");//<input type= "text" >$ ("Input:text");//you can do it.$ ("Input:file");//
jquery Selector Detailed