<script type="text/javascript">
document.onkeydown = function (e) {
var theEvent = window.event || e;
var code = theEvent.keyCode || theEvent.which;
if (code == 13) {
$("#btnQuery").click();
}
} </script>
$(":input").bind("keyup", function (event) {
if (event.keyCode == "13") {
$("#btnQuery").click();
}
})
转载于:https://blog.51cto.com/feelmanc/1250521