jQuery API jQuery API 中英文对照版 - jQuery在线查询手册
not
not(el)

从匹配的元素集合中删除指定的元素。这个方法用于从一个jQuery对象中删除一个元素。

返回值:jQuery

参数:

  • el (Element): 要删除的元素
 
示例:

从所有的段落集合中删除ID为selected的元素。

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

HTML 代码:

<p>Hello</p><p id="selected">Hello   Again</p>

结果:

[ <p>Hello</p> ] 
 
not( el )

Removes the specified Element from the set of matched elements. This method is used to remove a single Element from a jQuery object.

Return value: jQuery
Parameters:

  • el (Element): An element to remove from the set
 

Example:

Removes the element with the ID "selected" from the set of all paragraphs.

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

Before:

 <p>Hello</p><p id="selected">Hello Again</p>  
Result:
 [ <p>Hello</p> ]