参考:

jquery 表单 清空

$(':input','#myform') 
.not(':button, :submit, :reset, :hidden') 
.val('') 
.removeAttr('checked') 
.removeAttr('selected');

这个js是可以实现清空表单中填写及传入的值的,但要注意:

1、jq实现,此<input />不能放在form表单内!;

2、直接写在onclick属性中即可

点赞(278)

评论列表共有 0 条评论

立即
投稿
返回
顶部