Results 1 to 3 of 3

Thread: plus 1 every one second

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259

    plus 1 every one second

    I want to add 1 to value of Input every one second:

    I use this code but it does not work right. What is the error ?

    <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>

  2. #2
    Hyperactive Member bsw2112's Avatar
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    292
    hello prokhaled

    try this

    tested in ie6.0 only

    Code:
    <html>
    <head>
    <SCRIPT language="JavaScript">
    function clock()
    {
    	document.tt.nu.value++
    	setTimeout("clock()",1000)
    }
    
    </SCRIPT>
    </head>
    <body onload="clock()">
    
    <form name=tt>
    <input type=text name=nu value=0>
    </form>
    
    </body>
    </html>
    bsw2112

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259

    Nice .. Good

    Thank you too much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width