Common UI interactions with jQuery
In this post, I am listing some of the commonly used UI interactions when working with jQuery.
Button click on pressing Enter over a text box
$(document).ready(function(){
$("#btnSearch").click(function(){
$(".alert").show();
});
$("#txtName").keypress(function (e) {
var key = e.which;
if (key == 13) // the enter key code
{
$("#btnSearch").click();
return false;
}
});
});
Comments
Post a Comment