Thread: Help Please!
View Single Post
05-11-2011, 12:20 PM
#3
linkbuilding5 is offline linkbuilding5
Status: I'm new around here
Join date: Apr 2011
Location:
Expertise:
Software:
 
Posts: 16
iTrader: 0 / 0%
 

linkbuilding5 is on a distinguished road

  Old

You can implement by using this javascript code.
<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var ms = 0;
var state = 0;
function startstop() {
if (state == 0) {
state = 1;
then = new Date();
then.setTime(then.getTime() - ms);
} else {
state = 0;
now = new Date();
ms = now.getTime() - then.getTime();
document.stpw.time.value = ms;
}
}
function swreset() {
state = 0;
ms = 0;
document.stpw.time.value = ms;
}
function display() {
setTimeout("display();", 50);
if (state == 1) {now = new Date();
ms = now.getTime() - then.getTime();
document.stpw.time.value = ms;
}
}
// End -->
</SCRIPT>

<!-- STEP TWO: Add this onLoad event handler into the BODY tag -->

<BODY onLoad="display()">

<!-- STEP THREE: Put this code into the BODY of your HTML document -->

<CENTER>
<FORM NAME="stpw">
Time:
<INPUT TYPE="text" Name="time">
<INPUT TYPE="BUTTON" Name="ssbutton" VALUE="Start/Stop" onClick="startstop()">
<INPUT TYPE="BUTTON" NAME="reset" VALUE="Reset" onClick="swreset()">
</FORM>
</CENTER>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.42 KB -->

Reply With Quote