0
中的第一行我尝试将用户重定向到其他页面,但如果他/她单击表格中的5,8或最后一个单元格,则不会发生任何事情。第一排没关系。但其他行不起作用。jQuery .eq()仅适用于表
$("#table td:not(:last-child,:eq(5),:eq(8))").click(function(){
var url = $(this).parent().find('td:last-child a[title="edit"]').attr('href');
if (url != undefined) {
location.href = $(this).parent().find('td:last-child a[title="edit"]').attr('href');
}
});
:EQ选择通过集合中的索引,父之内没有索引。尝试:nth-child() –
也许你应该使用类而不是第5和第8行。 – jantimon
@KevinB那么我怎样才能分别影响所有行 –