<div class="htmlarea"> <textarea id="runcode54955"> <div id="box">9</div> <script> document.getElementByIdx_x=function(id){ if(typeof id =='string') return document.getElementById(id); else throw new error('please pass a string as a id!') } var timer = window.setInterval(function(){ document.getElementByIdx_x('box').innerHTML = parseInt(document.getElementByIdx_x('box').innerHTML) - 1; if(parseInt(document.getElementByIdx_x('box').innerHTML) < 0) { window.clearInterval(timer); window.location = 'http://www.jb51.net'; } }, 1000); </script> </textarea><br><input onclick="runEx('runcode54955')" type="button" value="运行代码"> <input onclick="doCopy('runcode54955')" type="button" value="复制代码"> <input onclick="doSave(runcode54955)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>