<html>
<head>
<script type="text/javascript">
var theTime = "";
function startTime()
{
theTime = window.setInterval("stTime()",1000);
}
function stopTime()
{
window.clearInterval(theTime);
}
function stTime()
{
today = new Date();
with(today);
{
document.form1.timer.value = getHours()+" 点 "+getMinutes()+" 分 "+getSeconds()+" 秒 ";
}
}</script>
</head>
<body onLoad="startTime();">
<form name="form1">
<h2>现在时间:</h2>
<input name="timer">
<h2>点击开始计时:</h2>
<input type="button" value="点击开始计时" onClick="startTime()">
<h2>点击停止计时:</h2>
<input type="button" value="点击停止计时" onClick="stopTime()">
</form>
</body>
</html>
难道是传说中的全角分号?
------------------------>
document.form1.timer.value = getHours()+" 点 "+getMinutes()+" 分 "+getSeconds()+" 秒 ";
with(today);
我加了个分号 迷糊结账