This is a memo on how to determine if the mouse is hovering over an element in JavaScript. Get the element with document.querySelector, and use addEventListener’s mouseout/mouseover events as shown below.
This logs output each time the mouse cursor hovers over or leaves the #main element.
document.querySelector('#main').addEventListener("mouseout", function(){console.log('out')});
document.querySelector('#main').addEventListener("mouseover", function(){console.log('over')});