JSFiddle - React, Tailwind, and code Playground
by vasi_32
HTML
number<br>
<input type="text" id="pooya">
<button onclick="multiple ()">try it</button>
<p>Explanation:</p>
<p>This for loop starts with i=0.</p>
<p>As long as <b>i</b> is less than, or equal to 5, the loop will continue to run.</p>
<p id="newVal">New Val : </p>
<p><b>i</b> will increase by 1 each time the loop runs.</p>
JavaScript
function multiple ( ){
var i=0;
for(var i=0;i<=5;i++){
document.getElementById("pooya").value += i;
//document.getElementById("pooya").innerHTML = i
//document.getElementById("newVal").innerHTML = i
}
}