using JavaScript:
How can I plus 1 to value of this Input box every second.
<input type=text name=number value=1>
Printable View
using JavaScript:
How can I plus 1 to value of this Input box every second.
<input type=text name=number value=1>
Use the setTimeout() function:
Where addone() is your function to add and 30 is the increment you wish to do it at.Code:setTimeout("addone()", 30);
Code:<form name=tt>
<input type=text name=number value=1>
</form>
<SCRIPT language="JavaScript">
function Clock()
{
NO=tt.number.value+1;
tt.number.value=NO
}
ID=setTimeout("Clock()",1000)
</SCRIPT>
but it convert 1 to 11 and no effect after that.
I want to add 1 to value to become 2 and after one second become 3 ... 4 ...5 ...5