jQuery :not() Selector (original) (raw)

Last Updated : 11 Jul, 2025

The jQuery :not() selector is used to select all the elements which are not selected.

Syntax:

$(":not(selector)")

Parameter:

Example 1: Change the background color of the p element.

HTML `

jQuery :not() Selector

Geeks for Geeks

A Computer Science Portal for Geeks

jQuary :not selector

I change my background color

language option

Change color

`

Output:

Example 2:

HTML `

jQuery :not() Selector

GeeksForGeeks

jQuery | :not() Selector

GFG-1

GFG-2

GFG-3

Change content

`

Output: