To attach keydown event to a html element, keydown()
method can be used.
<script>
$("#txtKeyPress").keydown(function () {
$("#div3").append(" | key DOWN event fired");
}
);
</script>
In the above code when user press any key in the “txtKeyPress” textbox, “ | key DOWN event fired” text will get appended in the “div3” element.
Views: 6513 | Post Order: 73