Script Categories

Calculators >>> Lap Time.

Calculates the average lap split time required to finish a race in the time you enter.

Number of laps:
Desired time: : (mm:ss)
Avg. Lap Time:

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">
/* Visit for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
function calc(form) {
var laps = (isNaN( parseInt(form.laps.value) )) ? 0 : parseInt(form.laps.value);
if (laps) {
var minutes = (form.minutes.value == "") ? 0 : parseInt(form.minutes.value);
var seconds = (form.seconds.value == "") ? 0 : parseInt(form.seconds.value);
return( ((minutes * 60 + seconds) / laps) + " seconds");
else return ("");
//  End -->
<form name=raceform>
<table border=1 width=300>
Number of laps:</td>
<input type=text name=laps size=2></td>
Desired time:</td>
<input type=text name=minutes size=2><b>:</b><input type=text name=seconds size=2>  (mm:ss)</td>
colspan=2 align=center><input type=button value="Calculate" onclick="this.form.laptime.value=calc(this.form);"></td>
Avg. Lap Time:</td>
<input type=text name=laptime></td>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.

Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).