home *** CD-ROM | disk | FTP | other *** search
- //Little bit number counting.
-
- var Num=1;
- var speed = 200;
- var Stopped=0;
-
- function Counting() {
- // to access a form object,
- // document.[FORMNAME].[OBJECTNAME].value=[whatever]
- document.counter.numbox.value=Num
- Num++
- if (Stopped == 0) {
- setTimeout("Counting()", speed); }
- }
-
- function startCounting() {
- Stopped = 0;
- Counting();
- }
-
- function stopCounting() {
- Stopped = 1;
- }
-
- document.writeln("Test");
- document.writeln("<FORM NAME=counter>");
- document.writeln("<INPUT TYPE=\"TEXT\" NAME=\"numbox\" SIZE=\"5\">");
- document.writeln("<INPUT TYPE=BUTTON VALUE=START onClick=\"startCounting()\">");
- document.writeln("<INPUT TYPE=BUTTON VALUE=STOP onClick=\"stopCounting()\">");
- document.writeln("</FORM>");
-
-