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

Finding Descendant Elements

$("table").find("span")   //selects all <span> elements contained   //somewhere in <table> elements $("#myForm").find("input")   //selects all <input> elements contained   //somewhere in element #myForm

The .find(filter) method returns a jQuery object representing descendants of the current set that match the filter supplied. The filter can be a selector, a jQuery object to match elements against, or an element tag name.

Example: Selects all <span> elements contained somewhere in <table> elements.

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