Madura Harshana Madura Harshana - 1 year ago 72
jQuery Question

jquery keydown event is not working properly

$("#id").keydown(function(evt) {
alert('Hello');
});


I tried this, but this is not working, Can you correct this ?

Answer Source

It works: http://jsfiddle.net/rrikesh/v7MdG/

HTML:

<input type="text" id="id">

JS:

$("#id").keydown(function(evt) {
     alert('Hello');
 });