jQuery ²Î¿¼ÊÖ²á - Ñ¡ÔñÆ÷
jQuery Ñ¡ÔñÆ÷
| Ñ¡ÔñÆ÷ | ʵÀý | ѡȡ |
|---|---|---|
| * | $("*") | ËùÓÐÔªËØ |
| #id | $("#lastname") | id="lastname" µÄÔªËØ |
| .class | $(".intro") | ËùÓÐ class="intro" µÄÔªËØ |
| element | $("p") | ËùÓÐ <p> ÔªËØ |
| .class.class | $(".intro.demo") | ËùÓÐ class="intro" ÇÒ class="demo" µÄÔªËØ |
| :first | $("p:first") | µÚÒ»¸ö <p> ÔªËØ |
| :last | $("p:last") | ×îºóÒ»¸ö <p> ÔªËØ |
| :even | $("tr:even") | ËùÓÐżÊý <tr> ÔªËØ |
| :odd | $("tr:odd") | ËùÓÐÆæÊý <tr> ÔªËØ |
| :eq(index) | $("ul li:eq(3)") | ÁбíÖеĵÚËĸöÔªËØ£¨index ´Ó 0 ¿ªÊ¼£© |
| :gt(no) | $("ul li:gt(3)") | Áгö index ´óÓÚ 3 µÄÔªËØ |
| :lt(no) | $("ul li:lt(3)") | Áгö index СÓÚ 3 µÄÔªËØ |
| :not(selector) | $("input:not(:empty)") | ËùÓв»Îª¿ÕµÄ input ÔªËØ |
| :header | $(":header") | ËùÓбêÌâÔªËØ <h1> - <h6> |
| :animated | ËùÓж¯»ÔªËØ | |
| :contains(text) | $(":contains('W3School')") | °üº¬Ö¸¶¨×Ö·û´®µÄËùÓÐÔªËØ |
| :empty | $(":empty") | ÎÞ×Ó£¨ÔªËØ£©½ÚµãµÄËùÓÐÔªËØ |
| :hidden | $("p:hidden") | ËùÓÐÒþ²ØµÄ <p> ÔªËØ |
| :visible | $("table:visible") | ËùÓпɼûµÄ±í¸ñ |
| s1,s2,s3 | $("th,td,.intro") | ËùÓдøÓÐÆ¥ÅäÑ¡ÔñµÄÔªËØ |
| [attribute] | $("[href]") | ËùÓдøÓÐ href ÊôÐÔµÄÔªËØ |
| [attribute=value] | $("[href='#']") | ËùÓÐ href ÊôÐÔµÄÖµµÈÓÚ "#" µÄÔªËØ |
| [attribute!=value] | $("[href!='#']") | ËùÓÐ href ÊôÐÔµÄÖµ²»µÈÓÚ "#" µÄÔªËØ |
| [attribute$=value] | $("[href$='.jpg']") | ËùÓÐ href ÊôÐÔµÄÖµ°üº¬ÒÔ ".jpg" ½áβµÄÔªËØ |
| :input | $(":input") | ËùÓÐ <input> ÔªËØ |
| :text | $(":text") | ËùÓÐ type="text" µÄ <input> ÔªËØ |
| :password | $(":password") | ËùÓÐ type="password" µÄ <input> ÔªËØ |
| :radio | $(":radio") | ËùÓÐ type="radio" µÄ <input> ÔªËØ |
| :checkbox | $(":checkbox") | ËùÓÐ type="checkbox" µÄ <input> ÔªËØ |
| :submit | $(":submit") | ËùÓÐ type="submit" µÄ <input> ÔªËØ |
| :reset | $(":reset") | ËùÓÐ type="reset" µÄ <input> ÔªËØ |
| :button | $(":button") | ËùÓÐ type="button" µÄ <input> ÔªËØ |
| :image | $(":image") | ËùÓÐ type="image" µÄ <input> ÔªËØ |
| :file | $(":file") | ËùÓÐ type="file" µÄ <input> ÔªËØ |
| :enabled | $(":enabled") | ËùÓ줻îµÄ input ÔªËØ |
| :disabled | $(":disabled") | ËùÓнûÓÃµÄ input ÔªËØ |
| :selected | $(":selected") | ËùÓб»Ñ¡È¡µÄ input ÔªËØ |
| :checked | $(":checked") | ËùÓб»Ñ¡ÖÐµÄ input ÔªËØ |
²ÎÔÄ
½Ì³Ì£ºjQuery ÔªËØÑ¡ÔñÆ÷Óï·¨