If enter key is pressed and then search button clicked event is called. My chrome doesn't work . IE is OK . How do I fix ? Thanks in advance
$('#txtSearch').keypress(function(e){
if(e.keyCode==13)
$('#btnSearch').click();
});
});
If enter key is pressed and then search button clicked event is called. My chrome doesn't work . IE is OK . How do I fix ? Thanks in advance
$('#txtSearch').keypress(function(e){
if(e.keyCode==13)
$('#btnSearch').click();
});
});
For chrome the variable name is different, so following should help:
$('#txtSearch').keypress(function(e){
var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
if(key == 13)
$('#btnSearch').click();
});
});
e.charCode
is used in Chrome