With a system that I use you can create custom fields. These fields all have the same html and css. Now I would like to get the value td where the th is week.
Now I use:
var week = $(this).find('td.bug-custom-field:last').text();
Which works but then I have to make sure it always is the last field. Is there a better way of doing this?
<table>
<tr>
<th class="bug-custom-field category">Name</th>
<td class="bug-custom-field" colspan="5">Test</td>
</tr>
<tr>
<th class="bug-custom-field category">Week</th>
<td class="bug-custom-field" colspan="5">23</td>
</tr>
</table>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…