Home >>jQuery Tutorial >jQuery :not() Selector

jQuery :not() Selector

jQuery :not() Selector

jQuery :not() selector in jQuery is used to selects all elements except the specified element.


Parameter Values

Parameter Description
selector It is a Required parameter and used to specifies the element to not select.
Here is an Example of jQuery :not() Selector

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
$("p:not(.txt)").css("background-color", "Orange");
<h1>Welcome to Phptpoint</h1>
<p class="txt">My name is Phptpoint</p>
<p>I live in Noida.</p>
<p>Who is your favourite:</p>
<ul id="choose">


Welcome to Phptpoint

My name is Phptpoint

I live in Noida.

Who is your favourite:

  • JAVA
  • jquery
  • Javascript