+ 4
How can i add a reset function in my code?
Tic Tac Toe Game - Reset Function/Button https://code.sololearn.com/WNAn819vsjek/?ref=app
3 Réponses
+ 2
Add a button like:
<button onclick="reset ()">Reset</button>
create a JavaScript function that loops through each number from 1 to 9 and clear the values:
function reset(){
for(i = 1; i < 9; i++){
document.getElementById(i.toString()).value = "";
}
}
+ 3
This code includes a reset function:
https://code.sololearn.com/WHrsYeZM65I3/?ref=app
+ 1
i think we have reset value type for input tag..
like <input type="reset" value="reset">