所以我有一个函数
$("#names tbody tr").click(#something here);
我想知道。因为我已经在表的 tr“内部”,所以从这里我如何使用 this 对象遍历每个单独的 td?
最佳答案
你可以这样做:
$("#names tbody tr").click(function(){
$(this).children('td').each(function(index, element){
//here are your td
})
});
关于javascript - 获取$(this)的子表数据,即表行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6549690/