Computer, Internet & Webmasters Zone...
Don't Forget to visit our Website at : www.CyberNinja.110mb.Com


The Best Forum With All The Useful Tips And Tricks and Guidance Regarding computer and internet security , Webmasters, software and sites review , webdesigning , html , css , javscripts etc.
 
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 Stop Watch In Javascript

Go down 
AuthorMessage
kriti.kulkarni

avatar

Posts : 2
Blades : 6160
Join date : 2010-06-15

PostSubject: Stop Watch In Javascript   Wed 16 Jun 2010 - 10:21

Can you please provide me the code for placing a STOP WATCH in my webpage .

I am running a survey and need a stop watch urgently..




Krits
India
Back to top Go down
View user profile
anjana

avatar

Posts : 7
Blades : 5954
Join date : 2010-11-29
Age : 32
Location : India

PostSubject: where is the script??   Mon 29 Nov 2010 - 9:16

Hey this question is been asked long BACK, and there is still no script out here. Is this forum dead . am i wasting my time here...??

I also needed the same for my blog, to show christmas countdown. But now i feel that christmas will be over before i get the clock.

Evil or Very Mad Evil or Very Mad Evil or Very Mad
Back to top Go down
View user profile
Admin
Admin
Admin
avatar

Posts : 30
Blades : 7838
Join date : 2008-04-15
Age : 35
Location : Cyber World.

PostSubject: Sorry   Wed 8 Dec 2010 - 15:24

Actually this question was not answered as the user was given the link to download this script...

Anyways we are sorry for this stupidity..

Here is the script..


Insert it between where ever you wanna display the watch..

Code:
<SCRIPT LANGUAGE="JavaScript">
/*
[You must be registered and logged in to see this link.]
*/

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;
  }
}

window.onload=display
</SCRIPT>


<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>


_________________


CyberNinja -aka- Doc CN (Administrator)


Complete Profile : [You must be registered and logged in to see this link.]
Website : [You must be registered and logged in to see this link.]
Blog : [You must be registered and logged in to see this link.]
Forum : [You must be registered and logged in to see this link.]
You Tube's Channel : [You must be registered and logged in to see this link.]
Back to top Go down
View user profile http://www.cyberninja.110mb.com
banarasi.babu

avatar

Posts : 6
Blades : 5868
Join date : 2010-11-29
Location : india

PostSubject: very nice script   Thu 9 Dec 2010 - 12:32

i used this script its really nice and simple...But how can i change the button colors and text box colors...can i do that??

Banarsi Babu Question Question
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Stop Watch In Javascript   

Back to top Go down
 
Stop Watch In Javascript
Back to top 
Page 1 of 1
 Similar topics
-
» Test javascript Calendar
» Help required with JavaScript and Selenese Parameter
» Javascript Array
» Where do you save javascript
» how to record a test case in javascript

Permissions in this forum:You cannot reply to topics in this forum
Computer, Internet & Webmasters Zone... :: Webmasters Zone :: Javascript Codes.-
Jump to: