Javascript examples for jQuery:Key Event
Event handler, jquery with Javascript
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.2.min.js"></script> </head> /*from w w w. java 2 s .com*/ <body> <button id="click"> Using jquery </button> <button onclick="click1()"> Using javascript </button> <script> $("#click").click(function() { console.log("You clicked the button"); }); function click1() { console.log("You clicked the button"); } </script> </body> </html>