是这样吗?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="JavaScript">
function showtime () {
var now = new Date();
var year = now.getYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var timeValue = hours + ':' + minutes + ':' + seconds
var nian = 2005
var yue = 2
var ri = 24
var shi = 17
var fen = 0
var miao = 0
var endt= new Date();
endt.setFullYear(nian,yue,ri)
endt.setHours(shi,fen,miao)
var chaju = endt.getTime() - now.getTime();
var myh = Math.floor(chaju / (1000 * 60 * 60))
var mym=Math.floor((chaju /(1000*60)) % 60)
var mys=Math.floor((chaju /1000)%60)
document.all.txtRecord.value =myh+':'+mym+':'+mys;
timerID = setTimeout('showtime()',1000);
timerRunning = true;
}
</script>
<body onLoad="showtime()">
现在离2005年3月24日17点还差:<input type="text" size="20" name="txtRecord">
</body>
</html>