<div class="codetitle"> <span><a style="CURSOR: pointer" data="47481" class="copybut" id="copybut47481" onclick="doCopy('code47481')"><u>複製程式碼</u></a></span>如下程式碼:</div> <div class="codebody" id="code47481"> <br><br><meta content="text/html;charset=utf-8"> <br><script><BR>y=1;<BR>function imgs()<BR>{<BR> var myImg = document.getElementsByTagName("img")[0];<BR> myImg.src=y ".jpg";<BR> if(y==2)y=1;<BR> y ; <BR>}<BR></script><br><br><br><divalign><br><img src="1.jpg" alt="javascript定時變換圖片實例程式碼_javascript技巧" ><br></divalign> </div> <br><br><br><br>