O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Filter Items Out Using Not Logic

$("div").not(".menu");   //selects <div> element; do not have class .menu $("option").not(function(){   return (this.value==0); }); });   //selects <option> elements that do not have value=0

The .not(filter) method reduces the set to match the filter. The filter can be a selector, one or more specific DOM elements, a jQuery object, or a function that tests each element and returns true if it should be included.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required