I want to clear an asp textbox when click to a button (html).
so basically the JS function is:
<script type="text/javascript">
function clearTextBox() {
document.getElementByID('<%=txtFName.ClientID%>').value = "";
}
</script>
And an asp.net TextBox
<asp:TextBox ID="txtFName" runat="server" class="form-control" placeholder="First name" AutoCompleteType="Disabled" MaxLength="30" />
And a HTML button
<span class="input-group-btn">
<button class="btn default" id="clearButton" type="button" onclick="clearTextBox()"><i class="fa fa-times"></i></button>
</span>
All buttons and other controls are in an asp update-panel (don't know if it makes different)
Nothing happend when I clicked to the HTML clearButton, error on the web console:
Uncaught TypeError: undefined is not a function
clearTextBox
onclick