|
-
Aug 11th, 2002, 09:03 AM
#1
Thread Starter
Hyperactive Member
plus or add 1 every second
using JavaScript:
How can I plus 1 to value of this Input box every second.
<input type=text name=number value=1>
-
Aug 11th, 2002, 12:51 PM
#2
Stuck in the 80s
Use the setTimeout() function:
Code:
setTimeout("addone()", 30);
Where addone() is your function to add and 30 is the increment you wish to do it at.
-
Aug 11th, 2002, 01:02 PM
#3
Thread Starter
Hyperactive Member
That is my code
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|