开发者

Capturing final stopwatch time

开发者 https://www.devze.com 2023-02-21 01:12 出处:网络
I want to use this stopwatch (or something similar): http://www.sivamdesign.com/scripts/dwld/stopwtch.txt

I want to use this stopwatch (or something similar):

http://www.sivamdesign.com/scripts/dwld/stopwtch.txt

but I will need to capture the final time that it is stopped on, and then store it as a variable (so I can later add it into a database). Is it possible to capture the time开发者_高级运维 as a variable?

Thanks for any help


If you're using the script you provided, you can access the final time via

document.clock.stwa.value

or to get the parts, you can access the vars sec, min and hour.

What are you planning on doing with the final time?

Edit: Then you can either post the value via AJAX or just throw form tags around the value textbox and add a submit button (or submit the value when user hits "Stop"). To start on page load, add this:

window.onload = function()
{
  stopwatch('Start');
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号