<input type="text" id="test" name="test"onkeypress="return onKeyPress(event)" />
function onKeyPress(e) {
var keyCode = null;
if(e.which)
keyCode = e.which;
else if(e.keyCode)
keyCode = e.keyCode;
if(keyCode == 13) {
search();
return false;
}
return true;
}
function search(){
console.log(1)
}