input清空和select重置

清空input和重置select标签

清空div下所有input的输入内容

$("#divId input").val("");

重置select

 $("#selectId option:first").prop("selected", 'selected')

 如果都在表单中写着,直接清空表单也可以

js中

$("#formId").reset();

因为reset方法是js的,在jquery中使用时要将jQuery对象转成js对象才行

$("#formId")[0].reset();

 2021-03-06

element清空表单+清空上传组件

 this.resetForm('elForm')
this.$refs.upload.clearFiles()
原文地址:https://www.cnblogs.com/wl1202/p/10736639.html