欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jQuery 獲取除某指定對(duì)象外的其他對(duì)象 ( :not() 與.not())

 更新時(shí)間:2018年10月10日 08:30:35   作者:你看我哪里像好人  
這篇文章主要介紹了JQuery 獲取除某指定對(duì)象外的其他對(duì)象 ( :not() 與.not()),需要的朋友可以參考下

 jquery獲取除某指定對(duì)象外的其他對(duì)象

.not()    遍歷方法    從匹配元素集合中移除元素

:not()     選擇器      選取除了指定元素以外的所有元素。

<ul>
 <li>list item 1</li>
 <li>list item 2</li>
 <li id="unwanted">list item 3</li>
 <li>list item 4</li>
 <li>list item 5</li>
</ul>

獲取ul中除 id="unwanted" 的其他所有 li

  $('li:not(#unwanted)').css('background', 'red');
  $('li').not('#unwanted').css('background', 'red');

總結(jié)

以上所述是小編給大家介紹的jQuery 獲取除某指定對(duì)象外的其他對(duì)象 ( :not() 與.not()),希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論