You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to quickly highlight the current table row on mouse hover with jQuery

Practice




How to quickly highlight the current table row on mouse hover with jQuery

very simple

$('table td').hover(function()
{
$(this).parent().find('td').css('background', 'rgb(199, 255, 181)');
}, function()
{
$(this).parent().find('td').css('background', 'white');
})

it doesn't work for me on some rows, on the ones I add to the table at runtime

$('table tr').eq(0).after( ' ')

$(document.body).on('mouseenter', 'table.list tr', function()
{
$(this).find('td').addClass('selrow');
});




$(document.body).on('mouseout', 'table.list tr', function()
{
$(this).find('td').removeClass('selrow');
});

thanks

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone