How to find a child element
Thu, 12/20/2007 - 03:52 — sgrover
We often need to find a particular element that is contained within our selected item. This is accomplished with the .children() method. This method returns an array of all the immediate children for an item. The results can be filtered by passing a selector to the method. So, imagine we had the ID for a table row, and we wanted to see the value of the table cell that had the class of "total".
$("#theRow").children("td.total");
If needing to find a child of a child, you'll need to call children multiple times, or use the .find() method.
$("#theRow").children("td").children("div.total");
OR
$("#theRow").find("td > div.total");
- Printer-friendly version
- Login or register to post comments

TMW2jDRc
drug testing
home test kits
detox drinks
drugtests
lemon detox