Javascript examples for jQuery Method and Property:keyup
Handle escape key event
<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>