I have a html page which contains textbox and checkboxes. When I call the javascript function to reset form using the reset button, textbox value has been reset. Checkboxes values reset in DOM, but not reflecting in UI. If I click anywhere in a webpage, then checkbox box value reset in UI.
What could be an issue?
HTML
<table width="100%" border="0" cellpadding="0" cellspacing="0"
class="table alignright">
<tr>
<td style="line-height: 30px;">Role:</td>
<td>
<input type="text" id="roleName" class="inp_style1" placeholder="" th:field="*{roleName}"/>
<input type="hidden" th:field="*{id}"/>
</td>
</tr>
<tr>
<td>Student<span class="input_checkbox"><input
type="checkbox" class="styled" name="1" th:field="*{student}" /></span></td>
</tr>
<tr>
<td>Staff<span class="input_checkbox"><input
type="checkbox" class="styled" name="1" th:field="*{staff}" /></span></td>
</tr>
</table>
<div class="bttn_box">
<button type="reset" id="resetBtn" style="display:none;"></button>
<a href="javascript:;" onclick="clearSelectForm()">Clear</a>
</div>
jQuery
function clearSelectForm() {
$('#showErrorMessage').html('');
$('#userError').html('');
$('#resetBtn').click();
}