<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>动态时钟</title>、
<script language="javascript">
function showClock()
{
var today= new Date()
var display=document.getElementById("display")
display.innerHTML=today.toLocaleString()
timer=window.setTimeout("showClock()",1000);
}
</script>
</head>
<body>
<p>
<input type="submit" name="Submit" value="开始" onClick="showClock()">
<input type="submit" name="Submit2" value="停止" onClick="window.clearTimeout(timer);)" >
</p>
<div id="display"></div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>动态时钟</title>、
<script language="javascript">
function showClock()
{
var today= new Date()
var display=document.getElementById("display")
display.innerHTML=today.toLocaleString()
timer=window.setTimeout("showClock()",1000);
}
</script>
</head>
<body>
<p>
<input type="submit" name="Submit" value="开始" onClick="showClock()">
<input type="submit" name="Submit2" value="停止" onClick="window.clearTimeout(timer);)" >
</p>
<div id="display"></div>
</body>
</html>