【发布时间】:2016-10-20 22:39:18
【问题描述】:
这是我的html页面:
<form id="userworklog" action="#" method="post">
<div id="userlogs" class="userlogs">
<table id="worklog">
<tr>
<th>Strt date</th>
<th>Projects</th>
<th>Charge# Field</th>
<th>Employee Name</th>
</tr>
<tr>
<td>
<input type= "date" id="startdate" name="startdate" class="required">
</td>
<td>
<input type="text" name="SearchBox" id="SearchBox" placeholder="Search...." />
<br />
<select id="projectsList" class="textFld" multiple="multiple"/>
</td>
<td>
<input type="text" id="comboBox" placeholder="Search.." />
<ul id="userList" class="nobull" style="width: 300px; height: 80px;list-style: none; overflow: auto">
</td>
</tr>
</table>
我有提交和重置按钮。我们正在动态加载数据并填充到 html。当我提交重置输入“开始日期”只是重置。要重置我使用 jQuery 的检查列表
$("#reset").on("click", function () {
$("#checkbox").attr("checked", false);
});
我可以重置项目和员工的搜索。除非我按进入项目列表数据在 html 中没有查看
【问题讨论】:
-
不要使用id选择器重置复选框的值。
标签: javascript jquery