skip to Main Content

Html – How to modify the event object before the DOM event callback function is executed

<body> <button onclick="myFunction()">CLICK</button> <script> function myFunction(event) { // do something based on the value of the event's property } </script> </body> <body> <button id="myButton">CLICK</button> <script> var button = document.getElementById("myButton"); button.addEventListener("click", myFunction); function myFunction(event) { // do something based on the…

VIEW QUESTION
Back To Top
Search