我尝试通过按类名选择 td 来获取 td 的列号。但它总是返回-1。怎么了?
HTML
<table >
<tbody>
<tr>
<td >apple</td><td class="current">banana</td><td>cherry</td>
</tr>
</tbody>
JS
console.log($("td.current:first").parent().parent().children().index($(this)));
最佳答案
关于javascript - jQuery - 无法获取 td 的列号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23425675/