Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>jQuery Event Handling</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> </head> <body> <button id="click-me">Click Me</button> <script> $(document).ready(function(){ $("#click-me").on("click", function(){ alert("Button clicked!"); }); }); </script> </body> </html>