js清空form表单里的值,清空input ,清空select

时间:2022-12-04 15:05:00
 清空form表单选择项:
 <div class="screen-window">		<form action="/Index/index" method="post" class="form-horizontal group-border hover-stripped">			<select class="control" name="clients_belong" >				<option value="">请选择</option>				<option value="1">你好</option>			</select>						<input type="text" name="timea" value=''>			<input type="text" name="timeb" value=''>						<button type="submit">确认提交</button>			<button id="qingkong" type="button">清空筛选</button>		</form>		</div>		<script src="/Public/js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>	<script type="text/javascript">		$("#qingkong").click(function(){			$(".screen-window form input").each(function(){				$(this).val('');			});			$(".screen-window form select").each(function(){				$(this).val('');			});		})	</script>