A glance at these JS functions setTimeout setinterval cleartimeout. Why?
Of course, the concept is confused! I just checked it and made a souvenir first:
Setinterval ("JS Code", Time): executes the specified JS Code once every time.
SetTimeout ("jscode", Time): Run Once after time... [run only once]
Cleartimeout ("reference of setTimeout"): clears the setTimeout timer.
1 < Html >
2 < Head > </ Head >
3 < Body >
4 < Div ID = "Intime" > </ Div >
5 < Div ID = "Timeouttime" > </ Div >
6 < Script Type = "Text/JavaScript" >
7 Function Showtime (Ele ){
8 Timer = New Date ();
9 Document. getelementbyid (Ele). innerhtml = Timer. gethours () + " : " + Timer. getminutes () + " : " + Timer. getseconds ();
10 }
11 SetTimeout ( " Showtime ('timeouttime ') " , 1000 );
12 Setinterval ( " Showtime ('intime ') " , 1000 );
13 </ Script >
14 </ Body >
15 </ Html >