<div class="codetitle"> <span><a style="CURSOR: pointer" data="31705" class="copybut" id="copybut31705" onclick="doCopy('code31705')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code31705"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><머리> <br><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <br><title>无标题文档</title> <br><script type="text/javascript"> <br>function util(){ <br>var elm=function(){ <br>return document.getElementById("testdiv"); <br>} <br>var createtxt=function(){ <br>var textnode=document.createTextNode("测试!"); <br>var divnode=document.createElement("div"); <br>divnode.appendChild(텍스트노드); <br>divnode를 반환합니다. <br>} <br><br>this.process=function(){ <br>elm().appendChild(createtxt()); <br>} <br>} <br><br>var c=new util(); <br>setInterval("c.process()",2000); <br></script> <br><br></head> <br><br><본문> <br><div id="testdiv"></div> <br></body> <br></html> <br> </div>