December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("option").filter( function (index) { return (this.value>5); }); //selects only the <option> elements with value=5 $("div").filter(".myClass"); //selects only the <div> elements with class="myClass"
The .filter(filter) method reduces the set to only those items matching the specified filter. The filter can be a selector, a specific DOM element, a jQuery object, or a function that tests each element and returns true if it should be included.
Read now
Unlock full access