javascript - Drilling down many levels (children and decendants) with jquery to get text -
trying drill down , name within table
element. have id name table. best way of drilling down great-great nesting element desired span
, , text ins
?
html
....<ins id="target"></ins>... <table id="names"> <tbody> <tr>...</tr> <tr> <td>..</td> <td>..</td> <td> <img /> <button>...</button> <span>text get</span> </td></tr></tbody></table>
incomplete jquery:
$(document).ready(function() { $("#target").text($("#names>tbody>???drilldown???).text()); });
try $("#names").find('span').text();
check demo here jsfiddle
Comments
Post a Comment