Keystroke events in jQuery

$('input').keydown(function(e) { // variable e contains keystroke data // only accessible with .keydown() if(e.which == 11) { e.preventDefault(); } }); $('input').keyup(function(event) { // run other event codes here });
This snippets shows the usage of keystroke detection using jQuery.

#keystroke #keyup #keydown #jquery


Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.