Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Call Multiple Functions in onClick Event in JavaScript</title> </head> <body> <button type="button" id="myBtn">Click Me</button> <script> // Defining custom functions function sayHello(){ alert("Hello World! sayHello() function executed successfully!"); } function sayHi(){ alert("Hi There! sayHi() function executed successfully!"); } // Selecting button element var btn = document.getElementById("myBtn"); // Assigning event listeners to the button btn.addEventListener("click", sayHello); btn.addEventListener("click", sayHi); </script> </body> </html>