I have the following JQuery:
$(document).ready(function () {
$('tr').hover(function () {
$(this).children().addClass("color2");
$(this).children().removeClass("color1");
});
});
But I only want it to add onto a td element which has an even index (including 0)
replace$(this)with$('td:even', this).Edit:
I didn’t see
children()the first time. So, replace$(this).children()with$('td:even', this).