Looking For An Example Of Javascript Onload Start Timer
- Forums
- Javascipt
- Looking For An Example Of Javascript Onload Start Timer
i am looking for a javascript code that will start the timer as soon as the page is loaded [828], Last Updated: Sat May 18, 2024
smifnoof
Sun Apr 10, 2011
1 Comments
2272 Visits
just wanted to ask you this script i have thats similar to yours, this javascript start loading once the page is loaded.
can you have it for me?
<html> <head> <title>Test</title> <script type="text/javascript"> var newCount; function timerFunction(position,count) { if (position == 'start') { document.getElementById("timer").innerHTML=count newCount = count + 1 setTimeout("timer('go',newCount)",1000) } if (position == 'go') { document.getElementById("timer").innerHTML=count newCount++; setTimeout("timer('go',newCount)",1000) } } </script> </head> <body onLoad="timerFunction('start',1);"> <div id="timer" /> </body> </html>