I try to use the .on() jQuery function for call something when the <li>
that I have, are hovered.
When I try to do something like this:
$("body").on({
mouseenter: function () {
console.warn('dansl\'body');
//stuff to do on mouse enter
},
mouseleave: function () {
console.warn('sorti');
//stuff to do on mouse leave
}
});
It works, i receive the messages when my body is hovered. But when i try to replace "body" by "li", it's not working anymore. How can I apply a .on() on a set of <li>
?
PS: My <li>
are generated after the document load.