I have the following HTML:
<table id="myTable">
<tr>
<td><div>test</div></td>
</tr>
<tr>
<td><div>test</div></td>
</tr>
</table>
I have a link to #myTablein a variable $myTable.
How can I select all tags divwithout using the string #myTableagain (i.e. use only the object $myTable)?
To clarify, assuming this example worked:
$('#myTable div')
... it does not meet my criteria since I do not want to re-specify #myTable.
In addition, I would prefer not to list each parent in the hierarchy as follows:
$myTable.children('tr').children('td').children('div')
I tried to use
$myTable.children('div')
... but it seems that only immediate children who are not elements are chosen div.
I want to use something short:
$myTable.descendants('div')