example.onmouseover = function() { example.style.background= "red"; }; example.onmouseleave = function() { example.style.background= "yellow"; };