<body> <button id="test">click me</button> <script> document.getElementById("test").addEventListener("click", function() { console.log("clicked: %o", this); }); </script> </body><!-- closing body tag -->