首頁  >  篩選  > not(expr|ele|fn)

返回值:jQuery not(expr|ele|fn)

概述

從匹配元素的集合中刪除與指定表達式匹配的元素

參數

expr String V1.0

一個選擇器字串。

element DOMElement V1.0

一個DOM元素

function(index) Function V1.4

一個用來檢查集合中每個元素的函式。this是目前的元素。

示例

描述:

從p元素中刪除帶有 select 的ID的元素

HTML 程式碼:

<p>Hello</p><p id="selected">Hello Again</p>
jQuery 程式碼:

$("p").not( $("#selected")[0] )
結果:

[ <p>Hello</p> ]