Prev Demo
jQuery
>
.Click() - Attach Click Event
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <style> #btnClick { color:red; } p{ color:green; } </style> </head> <body> <input type="button" name="btn1" id="btnClick" value="Click Here"/> <br /> <p>By clicking on the above button you can declare the click event.</p> <script> $("#btnClick").click(function () { alert("click event called."); }) </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output