jQuery API | jQuery API 中英文对照版 - jQuery在线查询手册 |
not(elems) |
not(elems)
从匹配的元素集合中删除所有符合条件的元素集合。这个函数用于从jQuery对象中删除一个或多个元素。 返回值:jQuery 参数:
从全部段落的集合中删除所有与“div p.selected”匹配的元素。 $("p").not( $("div p.selected") ) HTML 代码: <div><p>Hello</p><p class="selected">Hello Again</p></div> 结果: [ <p>Hello</p> ] Removes any elements inside the array of elements from the set of matched elements. This method is used to remove one or more elements from a jQuery object. Please note: the expression cannot use a reference to the element name. See the two examples below. Return value: jQuery
Example: Removes all elements that match "div p.selected" from the total set of all paragraphs. $("p").not( $("div p.selected") )Before: <div><p>Hello</p><p class="selected">Hello Again</p></div>Result: [ <p>Hello</p> ] |