我有以下代码:
$('table.tableElements thead|tbody tr').children().hover(function(){
// How can I do this ↑
});
我想抓住所有tr's
或 thead
而不是tbody
。{
我怎么能这样做?
答案 0 :(得分:3)
$('table.tableElements thead tr, table.tableElements tbody tr ')
有点冗长,但会奏效。
答案 1 :(得分:3)
尝试使用not
方法排除tfoot
行:
$('table.tableElements tr').not('tfoot tr').children().hover(function(){
// code....
});
答案 2 :(得分:2)
$('table.tableElements thead tr, table.tableElements tbody tr').children().hover(function() {
});
答案 3 :(得分:1)
$('table.tableElements thead tr, table.tableElements tbody tr')