【HTML】form表单重置、清空方法记录

form表单重置、清空方法记录

myform 是 form 的 id 属性值

调用 reset()方法

function fomrReset()
{
     document.getElementById("myform").reset();
}

逐个清空input、select值

function resetAll() {
    $("#myform").find('input[type=text],select,input[type=hidden]').each(function() {
    $(this).val('');
   });
}