Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Event Handling</title> </head> <body> <button id="clickMe">Click Me</button> <script> document.getElementById('clickMe').addEventListener('click', function() { alert('Button Clicked!'); }); </script> </body> </html>