<div class="hello">
  <h1>Mouse is here!</h1>
</div>
const title = document.querySelector(".hello:first-child h1");

function handleMouseEnter() {
title.innerText = "Mouse is here!"
}

function handleMouseLeave() {
title.innerText = "Mouse is gone!"
}

title.addEventListener("mouseenter", handleMouseEnter);
title.addEventListener("mouseleave", handleMouseLeave);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.