Handle escape key event - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:keyup

Description

Handle escape key event

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.11.0.js"></script> 
      <script type="text/javascript">
    $(function(){/*from   w w w  .j  av  a2s.  c o  m*/
$('input').keyup(function(e){
    if(e.keyCode == 27){
       console.log("test");
    }
});
    });

      </script> 
   </head> 
   <body> 
      <input>  
   </body>
</html>

Related Tutorials