English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery :not() Selector

jQuery Selectors

The :not() selector selects elements that do not match the givenSelectorAll unmatched elements.

It is usually used with another selector to select all contents except the specified element in the group.

Syntax:

$ (":not(selector)")

Example

Select all <p> elements except those with class="demo":

$ (document).ready(function () {
  $("p:not(.demo)").css("background", "yellow");
});
Test See‹/›

Parameter Value

ParameterDescription
selectorSelector for Filtering

jQuery Selectors