jQuery¼¼Êõ

jQueryѧϰ֮һ(2)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-12-12 11:19 ÎÒÒªÆÀÂÛ( )

4.first-of-type£¬last-of-type ËùÓÐËùÓÐÆ¥Åä±êÇ©µÄµÚÒ»¸ö£¬×îºóÒ»¸ö£¬ºÍΨһһ¸ö Tane / ul $("ul li:first-of-type");// li Karl / li , li Glen / li $("ul li:last-of-type");// li Brandon / li , li Tane / l

4.first-of-type£¬last-of-type
ËùÓÐËùÓÐÆ¥Åä±êÇ©µÄµÚÒ»¸ö£¬×îºóÒ»¸ö£¬ºÍΨһһ¸ö

> > >Tane> </ul> $("ul li:first-of-type");// <li>Karl</li>, <li>Glen</li> $("ul li:last-of-type");// <li>Brandon</li>, <li>Tane</li> ±íµ¥Ñ¡ÔñÆ÷

1.£ºinput

<input type="file" /> <input type="hidden" /> <input type="image" /> $(":input");//<input type="file" />,<input type="hidden" />,<input type="image" />

2.ÆäËûµÄ¾ÍºÜ¼òµ¥ÁË£¬ÊÇÄĸöÑ¡ÔñÆ÷¾Í¶ÔÓ¦µÄÑ¡Ôñ±êÇ©¾Í¿ÉÒÔÁË£¬ÏÂÃæÒÔµ¥Ñ¡¿òºÍ¸´Ñ¡¿ò´ò±È·½¡£
£ºradio£¬£ºcheckbox

<input type="checkbox" /> <input type="file" /> <input type="password" /> <input type="radio" /> $("input:radio");//<input type="radio" /> $("input:checkbox");//<input type="checkbox" /> ±íµ¥¶ÔÏóÊôÐÔ

1.:enabled,:disabled
Æ¥ÅäËùÓпÉÓõIJ»¿ÉÓõÄÔªËØ

=="id" /> </form> $("input:enabled");//<input name="id" /> $("input:disabled");//="disabled" />

2.:checked£¬µ¥¸´Ñ¡¿òµÄÑ¡ÖУ¬selectµÄoption±»Ñ¡ÖÐ

===> </select> $("input:checked");//="checked" /> $("option:checked");//<option checked="checked">1</option>

3.:selected£ºÆ¥ÅäËùÓб»Ñ¡ÖеÄoptionÔªËØ

=="checked">3</option> </select> $("select option:selected");//="checked">3</option>

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • jqueryæ— new构建学习笔记

    jquery无new构建学习笔记

    2017-12-11 17:19

  • 5¸ö×¼¶jQueryͼ±íÀà¿â²å¼þ

    5¸ö×¼¶jQueryͼ±íÀà¿â²å¼þ

    2017-12-11 11:00

  • jQuery ÈëÃŽ̳Ì(11): ·½·¨Á´

    jQuery ÈëÃŽ̳Ì(11): ·½·¨Á´

    2017-12-10 14:11

  • ´´½¨Ò»¸ö¾«ÃÀµÄjqueryͼƬ¿âЧ¹û

    ´´½¨Ò»¸ö¾«ÃÀµÄjqueryͼƬ¿âЧ¹û

    2017-12-10 10:28

ÍøÓѵãÆÀ
"