Skip to content
Related Articles

Related Articles

jQuery | :not() Selector

View Discussion
Improve Article
Save Article
  • Last Updated : 27 Feb, 2019
View Discussion
Improve Article
Save Article

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




  • selector: Used to specify that the element not to be selected. The selector parameter accept any kind of selector.

Example: Change background color of p element.

<!DOCTYPE html>
    <script src=
        $(document).click(function() {
              "background-color", "green");
        <h1>Geeks for Geeks</h1>
        <p class="intro">
          A Computer Science Portal for Geeks
        <p>jQuary :not selector
        <p>I change my background color
        <p>language option</p>
        <ul id="choose"
                   margin:0 auto;">
          Change color



My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!