Source Code:
(back to article)
Submit
Result:
Report an issue
<button id="multiEventButton">Click or Hover</button> <script> const button = document.getElementById("multiEventButton"); button.addEventListener("click", function () { alert("Button clicked!"); }); button.addEventListener("mouseover", function () { button.style.backgroundColor = "lightblue"; }); </script>