alin19 Posted February 12, 2008 Share Posted February 12, 2008 <script language="JavaScript"> <!-- var clockID = 0; function Update() { var x=0; document.write(x); var x=x+1; clockID = setTimeout("Update()", 100); } //--> </script> <body onload="Update()"> </body> Quote Link to comment Share on other sites More sharing options...
nogray Posted February 12, 2008 Share Posted February 12, 2008 define the x outside the function var x=0; function Update() { document.write(x); x++; clockID = setTimeout("Update()", 100); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.