+ 4
How to clear input field just after hitting submit button?
How to clear input field automatically just after the submit button has clicked?
3 odpowiedzi
+ 6
This should work:
let inputField = document.getElementById("inputField")
let submitBtn = document.getElementById("submitBtn")
submitBtn.addEventListener("click", () => {
inputField.value = "";
}
+ 3
This works without JS:
HTML:
<form>
<input />
<input type="reset" value="Submit" />
</form>
0
Are you use the MySQL ? For database ?