Ok, I am making a swoopo clone from scratch, i mean everyone knows the site www.swoopo.com I have made everything but now, since i am not that good with javascript, i don't know how to do that counter that resets everytime a user press bid. Any help / ideas ? Thank you!
Here is something kind of simple: <html> <head> <script type="text/javascript"> function startTimer() { setTimeout(coutdown, 1000); } function coutdown() { var timeLeftObj = document.getElementById('timeLeft'); timeLeftObj.innerHTML = (parseInt(timeLeftObj.innerHTML) - 1); startTimer(); } function resetTimer() { var timeLeftObj = document.getElementById('timeLeft'); timeLeftObj.innerHTML = '100'; } </script> </head> <body onload="startTimer();"> <input type="button" value="Reset!" onclick="resetTimer();" /> <br /> <span id="timeLeft" style="font-size: 32px; font-weight: bold;">100</span> </body> </html> Code (markup):