如何在使用jQuery的表中定位第二個<tr>
?我是否使用.closest
或nth-child
?jQuery - 選擇表中的第二行?
// something like this..
var MyLocation = $('.myclass').closest('tr').after('tr'); // fixed
<table class ='myclass'>
<tr>
<td></td>
</tr>
<!-- put some thing here -->
<tr>
</tr>
還要確保您使用$與週期類的名稱,而不是$之前( '我的課')。沒有這段時間,你會在這個答案上尋找一個名爲 –
Zak