Source Code:
(back to article)
Submit
Result:
Report an issue
<div> <p id="hoverText">Hover over me to highlight.</p> </div> <script> document.getElementById('hoverText').addEventListener('mouseover', function() { this.style.color = 'green'; }); document.getElementById('hoverText').addEventListener('mouseout', function() { this.style.color = 'black'; }); </script>