jquery实现form表单的submit和reset

<form id="formId" action="">

<input type="reset" style="display:none">

<div onclick="saveData()">保存</div>

<div onclick="cencelData()">取消</div>

</form>

<script>

function saveData(){
  $("#formName").submit();
}
function cencelData(){
   $("input[type=reset]").trigger("click");//触发reset按钮 }
}

</script>

猜你喜欢

转载自blog.csdn.net/u010591939/article/details/50260285
今日推荐