Stopwatch with lap Script

This stopwatch-with-lap script is used for calculating time for any event and can be used in any html page.

Features

  • You can use this stopwatch timer with lap for any event to calculate the time.
  • You can reset the time using Reset button.
  • Just download and use it.

Preview




Lap #Running TotalThis Lap

Downloads

Javascript Code


<!-- Script by hscripts.com -->
<script type="text/javascript" src="hstopwatch-with-lap/stopwatch-with-lap.js">
</script>
<body onload='stopwatch();'>
<br><div align=center><input type='text' id='disp' maxlength=12 readonly><br><br>
<button type='button' onclick='ss()' id='butt'>Start/Stop</button>
<button type='button' onclick='r()' id='butt2'>Reset</button>
</div>
<br>
<table align=center border=1>
<tr><th width=65>Lap #</th><th width=112>Running Total</th><th width=112>This Lap</th></tr>
<tr><td colspan=3>
<div align=center id='lap'>
</div>
</td></tr>
</table>
</body>
<!-- Script by hscripts.com -->

CSS Code


<style type='text/css'>
#disp
{
background-color: black;font-size: 1.75em;font-weight: bold;color: white;width: 7.65em;
font-family: "Courier New";padding: 0.15em;
border-right-width:0;
}
#butt
{
font-size: 1em;width: 8em;font-family: "Courier New";
}
#butt2
{
font-size: 1em;
width: 5em;font-family: "Courier New";
}
#lap
{
margin-top: 0.5em;
}
</style>


Usage

  • Unzip the download.
  • You will get hstopwatch-lap/stopwatch-lap.js and hstopwatch-lap/README files.
  • In javascript file, <body onload='stopwatch();'> is used inorder to perform the stopwatch function with lap while the page is loaded.
  • Hence call 'stopwatch()' in the body tag.

License

Related Scripts

Free Javascript Scripts


Ask Questions

Ask Question