久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jquery怎樣獲取除自己外的元素

      在jquery中,可以利用not()方法和this關(guān)鍵字來(lái)獲取除自己外的元素,not()方法用于返回指定元素中不符合條件的元素,this關(guān)鍵字可以選中當(dāng)前的一個(gè)對(duì)象,作為符合條件的元素,語(yǔ)法為“$("父元素 *").not(this)”。

      jquery怎樣獲取除自己外的元素

      本教程操作環(huán)境:windows10系統(tǒng)、jquery3.2.1版本、Dell G3電腦。

      jquery怎樣獲取除自己外的元素

      可以利用not()方法和this關(guān)鍵字來(lái)獲取除自己外的元素。

      not() 方法返回不符合一定條件的元素。

      該方法讓您規(guī)定一個(gè)條件。不符合條件的元素將從選擇中返回,符合條件的元素將被移除。

      該方法通常用于從被選元素組合中移除一個(gè)或多個(gè)元素。

      示例如下:

      <html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> <script type="text/javascript"> $(function(){     $("div p").click(function(){   $("div *").not(this).remove();   });   });  </script> </head> <body>     <div>         <p class="aa">aa</p>         <p class="bb">bb</p>         <p class="cc">cc</p>     </div> </body> </html>

      輸出結(jié)果:

      jquery怎樣獲取除自己外的元素

      相關(guān)視頻教程推薦:jQuery視頻教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)