我有以下代码:
var td = textbox.closest('tr').children('td:first');我想获取表中最接近tr的索引,并将其设置为一个变量,因此我需要将index()函数放在最接近(‘tr’)和子级(‘td:first’);之前。如下所示:
var td = textbox.closest('tr').index(/*PUT A FUNCTION HERE */).children('td:first');我知道我可以像这样做到这一点:
var index = textbox.closest('tr').index();发布于 2012-11-13 23:02:47
index函数返回一个数字,而不是jQuery对象。你不能把它链起来。
https://stackoverflow.com/questions/13363054
复制相似问题