DJRobThaMan
11-09-2003, 03:58 PM
I can't seem to find anything really wrong with this code but for some reason it just won't work. Anybody have any ideas?
<html>
<head>
<title>
STOP WATCH
</title>
<script type="text/javascript">
<!--
var l = 0;
var i = 0;
var j = 0;
var k = 0;
function timer(){
i = ((i + 1)%10);
if(i == 0){
j = ((j+1)%6);
++l;
}
if(j == 0){
if(l > 1){
if(i == 0){
++k;
}
}
}
document.getElementById("clock").style.innerHTML = eval('k') + ":" + eval('j') + eval('i');
}
function start(){
time = setInterval('timer()',100);
}
function stop(){
clearInterval(time);
}
-->
</script>
</head>
<body>
<div id="clock">
</div>
<BR>
<input type="button" value="Start Timer" onClick="start()">
<input type="button" value="Stop Timer" onClick="stop()">
</body>
</html>
Thanks
<html>
<head>
<title>
STOP WATCH
</title>
<script type="text/javascript">
<!--
var l = 0;
var i = 0;
var j = 0;
var k = 0;
function timer(){
i = ((i + 1)%10);
if(i == 0){
j = ((j+1)%6);
++l;
}
if(j == 0){
if(l > 1){
if(i == 0){
++k;
}
}
}
document.getElementById("clock").style.innerHTML = eval('k') + ":" + eval('j') + eval('i');
}
function start(){
time = setInterval('timer()',100);
}
function stop(){
clearInterval(time);
}
-->
</script>
</head>
<body>
<div id="clock">
</div>
<BR>
<input type="button" value="Start Timer" onClick="start()">
<input type="button" value="Stop Timer" onClick="stop()">
</body>
</html>
Thanks