jQuery capture ‘Enter’ key in text field
Fiddle
http://jsfiddle.net/pootie/8wGFe/2/
Code
$(document).ready(function() { $('#searchBox').keypress(function(event){ var keycode = (event.keyCode ? event.keyCode : event.which); if(keycode == '13'){ alert('You pressed a "enter" key in textbox'); } }); } |
Comments are closed, but trackbacks and pingbacks are open.