I am trying to retrieve all rows from within a <tbody>
section of a table, but am unsure of the syntax for doing so. I've included a dummy table extract below and my latest attempt for achieving the task with jQuery!
Table extract:
<tbody>
<tr>
<th id="emergency" colspan="2">Emergency</th>
</tr>
<tr>
<td>Emergency data</td>
<td>Emergency data</td>
</tr>
<tr>
<td>Emergency data</td>
<td>Emergency data</td>
</tr>
</tbody>
<tbody>
<tr>
<th id="urgent" colspan="2">Urgent</th>
</tr>
<tr>
<td>Urgent Data</td>
<td>Urgent Data</td>
</tr>
<tr>
<td>Urgent Data</td>
<td>Urgent Data</td>
</tr>
</tbody>
jQuery code:
var emergencyRows = $table.find('#emergency').children().get();