$('tr').hover(function(event) {
$(this)[ (event.type == 'mouseenter' ? 'add' : 'remove') 'Class' ]('test'); //test is style
});
$('tr').hover(function(event) {
$(this).toggleClass('test'); //test is style
});
$( 'tr').hover(function(){
$(this).addClass('test'); //test is style
}, function(){
$(this).removeClass( 'test'); //test is style
});
Note: Under normal circumstances, it is okay to use the second method, but when encountering table rows that can be dragged, Then there will be a BUG, and you will know it through self-testing.