2
I’m with this code but it’s not picking up. I want to increment every click on "Increment".
Code:
function incrementar(){
for (let i =0; i<10; i++){
document.getElementById("incrementar2").innerHTML = i;
}
}
<html>
<body>
<button onClick="incrementar()">
Incrementar
</button>
<div id="incrementar2"> 0
</div>
</body>
</html>
But it is not going at all, it goes straight to number 9. Someone can help me ?
Can make a table test of your code?
– Woss
Either replace the number by intervals or add content?
– RpgBoss
@Rpgboss add to the content. Example, the number ta 0, when I click the button, it go pro 1 and so on.
– Jota
Now I understand, but @Valdeir Psr has posted the solution and explanation.
– RpgBoss