我希望使用<tr>来锁定第二个<td>和第二个<td>标记。我知道我可以给<td>标记一个类,并且只针对那个类,但是我想这样做。到目前为止,这就是我所得到的:
$('#playlist tr:nth-child(2)'); <table id="playlist">
<tr class="bold">
<td>ID:</td>
<td>Track-Name:</td>
<td>Artist:</td>
<td>Duration:</td>
</tr>
<tr>
<td class="idD">1</td>
<td id="first" song="Weown.mp3" cover="cover.jpg" artist="The Wanted">We Own The Night</td>
<td>The Wanted</td>
<td class="idD">3:25</td>
</tr>
</table>发布于 2015-11-02 13:02:55
这将是:
$('#playlist tr:nth-child(2) td:nth-child(2)'); http://jsfiddle.net/kzwbkfz3/
发布于 2015-11-02 13:03:42
考虑以下几点:
$('#playlist tr:nth-child(2) td:nth-child(2)')
//or
$('#playlist tr:eq(1) td:eq(1)')看到它的行动
详细信息:*nth-child(),:eq()
发布于 2015-11-02 13:22:53
https://stackoverflow.com/questions/33478215
复制相似问题