I need to execute a button click event upon pressing key enter.
As it is at the moment the event is not firing.
Please Help me with the syntax if possible.
$(document).on("click", "input[name='butAssignProd']", function () {
//all the action
});
this is my attempt to fire click event on enter.
$("#txtSearchProdAssign").keydown(function (e) {
if (e.keyCode == 13) {
$('input[name = butAssignProd]').click();
}
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…