-2
I wanted a way to only fire the event if the user remained with the mouse on the target for more than 3 seconds. If it remains for less than 2 seconds the event should not be triggered.
const e = document.querySelector("p");
e.onmouseenter = () => {
alert(e.textContent);
};
p {
margin: auto;
width: fit-content;
padding: 10px;
}
<p>Passe o mouse<p>
Show brother, too good, thank you very much
– God of all wars
@Erenilsonchristopher if the answer solved your problem please mark it as correct
– Guilherme Nascimento
Blz, I’m just waiting for the four-minute break
– God of all wars
@Erenilsonchristopher I always forget that interval, long time that I do not answer on the site :) thanks!
– Guilherme Nascimento