JSFiddle - React, Tailwind, and code Playground
by hannahtaylor
HTML
<div id="box" onmouseover="yellow(this)" onmouseout="red(this)"></div>
<p>Put your mouse over the box to see it change color. Move your mouse out of the box to change it back.</p>
CSS
#box {
background-color: #e65f5c;
height: 200px;
width: 200px;
}
JavaScript
function yellow(x) {
x.style.backgroundColor = "#ffff82";
}
function red(x) {
x.style.backgroundColor = "#e65f5c";
}