For dynamically created content, I am using the 'on' method to handle events. That works fine with click but not with hover.
Here is the code:
$(document).on('click', 'li', function(){
alert('a');
});
Works but
$(document).on('hover', 'li', function(){
alert('a');
});
does not.
Is the code wrong? Or the problem arises cause of something else on my setup.
$(document).on(mouseenter: function(){}, mouseleave: function{}, 'li');