Alex W.: stoppuhr?

Beitrag lesen

<html>
<head>
<script>
<!--
var stunden, minuten, sekunden;
var i = 0;
var j = 0;
var k = 0;
var l = 0;
function uhr()
 {
   i++

var milli          = i;

if (milli > 999)
 { j++; i = 0; }
if (sekunden  > 59)
 { k++; j = 0; }
if (minuten  > 59)
 { l++; k = 0; }

sekunden = j;
minuten = k;
stunden = l;

window.document.Datum.Time.value=stunden+":"+minuten+":"+sekunden+":"+milli;

window.setTimeout ('uhr()',i);
 }
-->
</script>
</head>
<body>
<FORM NAME="Datum">
<INPUT SIZE=10 NAME="Time" class="field">
<br>
<br>
<input value="Start" type="button" onClick="window.setInterval('uhr()',1);" class="field">
</form>
</body>
</html>