jquery add hover state code example
Example 1: jquery hover
$( "td" ).hover(
() => {
$(this).addClass("hover");
},
() => {
$(this).removeClass("hover");
}
);
$( "td" )
.mouseover( () => {
$(this).addClass("hover");
})
.mouseout( () => {
$(this).removeClass("hover");
}
);
$( "td" )
.mouseenter( () => {
$(this).addClass("hover");
})
.mouseleave( () => {
$(this).removeClass("hover");
}
);
Example 2: jquery on hover dynamic elements
$(document).on("mouseenter", "li", function() {
});
$(document).on("mouseleave", "li", function() {
});