======>>>菜鸟问关于计时器问题,大虾帮忙<<<<<==========
<span id= "span1 "> 60 </span>
用javascript定时每阁一分钟调用span中的值自动减1,这段javascript怎么写?
------解决方案--------------------可以用setTimeout和setInterval ;
推荐用setTimeout:
<script>
function setzero(){
var obj = document.getElementById( "span1 ");
obj.innerHTML = parseInt(obj.innerHTML)-1;
window.setTimeout( "setzero() ",60000);
}
</script>