PHP
·
发表于 5年以前
·
阅读量:8303
$(document).on("keypress", ":input:not(textarea)", function(event) {
return event.keyCode != 13;
});
$(document).on("keypress", ":input:not(textarea)", function(event) {
if (event.keyCode == 13) {
//check control
event.preventDefault();
}
});
<form ... onkeypress="return event.keyCode != 13;">