Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

would like you know how to loop this counter

Status
Not open for further replies.

mercifulrelease

Technical User
May 3, 2008
2
GB
Hi,
I would like to know how to continuously loop this counter function. I have very little knowledge of scripts of any kind. Its part of an art project to have a continuous counter repeating itself. I discovered the counter which is extactly the right size and speed but i'm unable to make it start again from zero. Cheers

<script languge="JavaSript">
<!--
var count = 0;
function counter() {
document.timer.field.value = count++;
if (count != 6)
setTimeout('counter()',2000);
}
counter();
//--></script>
 
[tt]function counter() {
document.timer.field.value = count++;
count=count%6;
setTimeout('counter()',2000);
}[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top