Event handler, jquery with Javascript - Javascript jQuery

Javascript examples for jQuery:Key Event

Description

Event handler, jquery with Javascript

Demo Code

ResultView the demo in separate window

<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>

Related Tutorials