Select Elements NOT Matching selector $(":not(selector)")

$(":not(selector)")

e.g. $("div:not([id])")

$(":not(selector)") selects elements NOT matching selector.

For example, $("div:not([id])") will find <div> elements that do NOT have id attribute.

<div>div</div>
<div id='someID'>div with id</div>
<p>p</p>
<div>div</div>
jQuery selector filter $(":not(selector)")