<div class="codetitle"> <span><a style="CURSOR: pointer" data="8822" class="copybut" id="copybut8822" onclick="doCopy('code8822')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code8822"> <br>var i = 5; <br>function init(){ <br>var i = 5; <br>function init(it()){ >//取得物件的控制權<br>var span1 = document.getElementById("span1"); <br>//修改其屬性<br>span1.innerHTML = i; <br>i--; <br> //定時的操作:window.setTimeout('',1000) window.setInterval(); <br>window.setTimeout('init()', 1000); <br>} </div>