<div id="box"></div>
const element = document.querySelector("#box"); element.addEventListener("mouseover", event => { console.log("Mouse in (over)"); }); element.addEventListener("mouseout", event => { console.log("Mouse out"); });