【发布时间】:2014-12-16 06:09:09
【问题描述】:
我想在提交后清除表单域(表单域有文本和复选框)。为了清除表单,我创建了一个按钮。并且有单独的提交按钮。
<input type="reset" name="clearform" id="clearform" value="Clear Form" />
<form id="submit" method="POST" action="">
我已经编写了 jQuery 代码,但它不起作用:
jQuery("#clearform").click(function(){
jQuery("#submit input[type='text'], input[type='checkbox']").each(function() {
this.value = '';
});
});
【问题讨论】:
标签: jquery