想得到倒计时的效果,为何没有产生效果?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>计时器</title>
<script type="text/javascript">
function dao(){
var end = new Date(2017,4,20,16,45);
var now = new Date();
var m = parseInt(Math.round((end - now)/1000));
document.getElementById("txt").value = m;
m= m-1 ;
}
setTimeout("dao()",1000);
</script>
</head>
<body>
<form>
<input type="text" id="txt" size="50" />
<input type="button" value = "开始时间" onClick = "dao()" />
</form>
</body>
</html>