document.querySelector('#counter').value = '';
<form id="myForm">
First name: <input type="text" name="fname" value="Demo"><br>
Last name: <input type="text" name="lname"><br><br>
<input type="file" name="Photo" class=" custom-file-input" id="photo">
<input type="button" onclick="myFunction()" value="Reset form">
</form>
<script>
function myFunction() {
document.getElementById("myForm").reset();
}
</script>
Run code snippetHide results