第一种最直接也相对来说最简便的
$('#模态框的id').on('hidden.bs.modal', function () {
document.querySelector('#form1').reset();
});
第二种比较繁琐
$(‘#模态框的id').on('hidden.bs.modal', function () {
//输入框清空
$("#表单id input").each(function(){
$(this).val('');
})
//下拉菜单清空
$("#表单id select").each(function(){
//$(this).find("option").remove();
console.log($(this).find("option").first().prop("selected"))
$(this).find("option").first().prop("selected",'true').change();
})
//单选框清空
$("#表单id input[type='checkbox']").each(function(){
this.checked=false
})
//自定义文本清空
$("#表单id textarea").each(function(){
$(this).val('');
})
});