Latest web development tutorials

jQuery: not () selector

jQuery selector jQuery selector

Examples

Select Apart class = "intro" all the elements <p> element:

$("p:not(.intro)")

try it"

Definition and Usage

: Not () selector selects all elements except the specified elements.

The most common usage: used in conjunction with other selectors, select the specified combination of all the elements except the specified elements (such as the above example).


grammar

$(":not(selector)")

参数 描述
selector 必需。规定不选择的元素。
该参数接受任何类型的选择器。

jQuery selector jQuery selector