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:
- selector: Used to specify that the element is not to be selected. The selector parameter accepts any kind of selector.
Example 1: Change the background color of the p element.
HTML `
jQuery :not() SelectorGeeks for Geeks
A Computer Science Portal for Geeks
jQuary :not selector
I change my background color
language option
- JAVA
- C++
- PYTHON
`
Output:
Example 2:
HTML `
jQuery :not() SelectorGeeksForGeeks
jQuery | :not() Selector
GFG-1
GFG-2
GFG-3
Change content
`
Output:

