У меня есть следующий код:
$('table.tableElements thead|tbody tr').children().hover(function(){ // How can I do this ↑ });
Я хотел бы поймать все tr's из thead ИЛИ tbody, но не tfoot. Как я могу это сделать?
tr's
thead
tbody
tfoot
Попробуйте метод not, чтобы исключить строки tfoot:
not
$('table.tableElements tr').not('tfoot tr').children().hover(function(){ // code.... });
$('table.tableElements thead tr, table.tableElements tbody tr ')
Немного многословно, но сработает.
http://api.jquery.com/multiple-selector/
$('table.tableElements thead tr, table.tableElements tbody tr').children().hover(function() { });
$('table.tableElements thead tr, table.tableElements tbody tr')