在表单中禁用“回车键”
$("#form").keypress(function(e) {
if (e.which == 13) {
return false;
}
});
清除所有的表单数据
$('#formID')[0].reset();
或者
$("#formID").each(function(){
this.reset();
});
$("#form").keypress(function(e) {
if (e.which == 13) {
return false;
}
});
$('#formID')[0].reset();
或者
$("#formID").each(function(){
this.reset();
});