$(document).on("mouseenter", "li", function() { // hover starts code here }); $(document).on("mouseleave", "li", function() { // hover ends code here });