我有一个动态表,它取决于 abc1 列的数量。
在此示例中,我在 abc1 列中有 2 行。值为 18 和 23
http://jsfiddle.net/SdN4L/
<table border=1>
<tr>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th align="center" colspan="3">abc</th>
<th rowspan="2"></th></tr>
<tr>
<th>abc1</th>
<th>abc2</th>
<th>abc3</th>
</tr>
<tr>
<td rowspan="2">2</td>
<td rowspan="2">16</td>
<td rowspan="2">a</td>
<td rowspan="2">300</td>
<td rowspan="2">b</td>
<td>18</td>
<td>c</td>
<td>333</td>
<td rowspan="2">31</td>
<td rowspan="2"><input type="button" value="Edit" name="edit" class="edit"></td>
<td rowspan="2"><input type="button" value="Delete" name="delete" class="delete"></td>
<td rowspan="2"><input type="button" value="Add" name="add" class="add"></td>
</tr>
<tr>
<td>23</td>
<td>d</td>
<td>322</td>
</tr>
</table>
当我单击编辑按钮时,我想做。它将显示下一行的值,如 3 步。我不知道怎么做3个步骤。我怎样才能做到这一点。谢谢
$('.edit').click(function(){
//1: get rowspan value of <td rowspan="2">edit input</td>
//2: for (i=1; i < rowspan.value; i++)
//3: alert('text of abc2') = 23 and d and 322
alert ($(this).parent().siblings().eq(7).text());
});