JSFiddle - React, Tailwind, and code Playground
HTML
<div id="demo"></div>
CSS
#demo {
background-color: pink;
height: 50px;
width: 100px;
}
JavaScript
demo = document.getElementById("demo");
demo.addEventListener("mousemove", function() {
demo.style.backgroundColor = "red";
});
demo.addEventListener("mouseout", function() {
demo.style.backgroundColor = "pink";
});