All elements that do not match the given selector can be selected using jQuery( “:not(selector)” ). For example, the first example selects all the <li> elements which are not active.
Example 1: This example selects <li> elements which does not contains the class active.
It can also be done using .not(selector).
Example 2: This example selects <div> elements which does not contains the class green or id blue.
- How to select a div with a certain class using jQuery ?
- How to Select a Range of Elements using jQuery ?
- How to select elements by attribute in jQuery ?
- How to select all elements that contains some specific CSS property using jQuery ?
- How to select all visible or hidden elements in a HTML page using jQuery ?
- jQuery | select() with Examples
- How to select the last row of a table using jQuery ?
- How to select an element by name with jQuery?
- How to select ID that starts with certain character using jQuery ?
- How to add options to a select element using jQuery?
- How to get N options from the <select> element using JQuery?
- How to select text nodes using jQuery ?
- How to select all on focus in input using JQuery?
- jQuery UI | Spinner to select numeric data
- How to select first element in the drop-down list using jQuery ?
- How to fire an event on file select using jQuery ?
- How to remove options from select element using jQuery ?
- How to select html element using ID in jQuery when ID contains a dot character ?
- How to select an element with multiple classes using jQuery ?
- How to find the parent class name with known class in jQuery ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.