<div id="foo" onmouseover="doSmth()">
<script>
doSomething(){
console.log("hovered")
}
</script>
<a onhover="doSomething()">Hover Here</a>
onHover = false;
to;
enter() {
this.to = setTimeout(() => {
this.onHover = true;
// doing some other stuff...
}, 2000);
}
leave() {
clearTimeout(this.to);
this.onHover = false;
// doing some other stuff...
}