Given the following table, how would I get the corresponding table header for each td element?
<table>
<thead>
<tr>
<th id="name">Name</th>
<th id="address">Address</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bob</td>
<td>1 High Street</td>
</tr>
</tbody>
</table>
Given that I currently have any of the td
elements available to me already, how could I find the corresponding th
element?
var $td = IveGotThisCovered();
var $th = GetTableHeader($td);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…