jQuery API | 返回首页目录 | jQuery API 中英文对照版 |
not(expr) |
not(expr)
从匹配的元素集合中删除与指定的表达式匹配的元素。这个函数用于从一个jQuery对象中删除一个或多个元素。 返回值:jQuery 参数:
从所有段落中删除ID值为selected的元素。 $("p").not("#selected") HTML 代码: <p>Hello</p><p id="selected">Hello Again</p> 结果: [ <p>Hello</p> ] Removes elements matching the specified expression from the set of matched elements. This method is used to remove one or more elements from a jQuery object. Return value: jQuery
Example: Removes the element with the ID "selected" from the set of all paragraphs. $("p").not("#selected") Before: <p>Hello</p><p id="selected">Hello Again</p>Result: [ <p>Hello</p> ] |