Answer can be in vanilla js or jQuery. I want to hide a div with the id \"myDiv\" if the user is no longer hovering over a link with the id \"myLink\" or a span with the id
Something like this should work:
var count = 0; $('#myLink, #mySpan').mouseenter(function(){ count++; $('#myDiv').show(); }).mouseleave(function(){ count--; if (!count) { $('#myDiv').hide(); } });
jsfiddle