0

how to reset values and how to add a switch statement to a function ?

https://code.sololearn.com/WA9r3xIKIitQ/?ref=app

29th Sep 2021, 9:26 AM
Mark Davis
Mark Davis - avatar
4 odpowiedzi
+ 4
document.getElementById('numb').value = ''; // Keep learning & happy coding :D
29th Sep 2021, 9:51 AM
SoloProg
SoloProg - avatar
29th Sep 2021, 9:55 AM
Vadivelan
+ 3
If you enclose the input and buttons inside a <form></form>, your reset button will work without you writing any code. You might want to prevent submission when the input is empty.
29th Sep 2021, 10:58 AM
Ipang
+ 1
Just use this in your HTML code <form> <input placeholder="Insert age here" /> <button> Submit </button> <input type="reset" /> </form>
29th Sep 2021, 3:35 PM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar