Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery :not() selector

jQuery :not() selector

jQuery selector jQuery selector

Example

Select all elements except those with class="intro"

element:

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

Try it »


Definition and Usage

The :not() selector picks all elements except the specified element.

The most common use: together with other selectors, to pick all elements in a specified combination except the specified element (as in the example above).


Syntax

$(":not(

selector

)")

Parameters Description
selector Required. Specifies the element not to be selected.
This parameter accepts any type of selector.

jQuery selector jQuery selector