Javascript examples for DOM:Document addEventListener
Document addEventListener() Method - Add many events to the document without overwriting existing events, add two click events to the document
<!DOCTYPE html> <html> <body> <script> document.addEventListener("click", myFunction); document.addEventListener("click", someOtherFunction); function myFunction() {//from ww w. j a v a2 s. c o m console.log("Hello World!") } function someOtherFunction() { console.log("This function was also executed!") } </script> </body> </html>