Javascript examples for jQuery Method and Property:keydown
Keydown listener for body
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript"> $(window).load(function(){/*from w ww .j ava2 s. c om*/ $('input').keydown(function(e){ e.stopPropagation(); }); $(document).keydown(function(e){ if (e.keyCode==32) { stopplay(); } }); }); </script> </head> <body> <input> </body> </html>