stop button from being clicked via keyboard - Javascript jQuery

Javascript examples for jQuery:Form Button

Description

stop button from being clicked via keyboard

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-3.1.1.js"></script> 
  <script type="text/javascript">
    window.onload=function(){/*from w w  w . jav a2  s . c  o m*/
$('button').click(function(){
   console.log($(this).text());
});
    }

      </script> 
 </head> 
 <body> 
  <button type="submit"> Submit 1 </button> 
  <button type="submit" tabindex="-1"> Submit 2 </button>  
 </body>
</html>

Related Tutorials