CreateElement:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" > <HTML> <HEAD> <TITLE> New Document &L t;/title> <meta name= "generator" content= "EditPlus" > <meta name= "Author" content= "" > <meta NAME= "Key Words "content=" "> <meta name=" Description "content=" "> <script type=" text/javascript "> Function init () {var stadate = new Date (); var doc = window.document; for (Var i=0;i<100;i++) {var odiv = doc.createelement ("div"); var otext = Doc.createtextnode ("text"); Odiv.appendchild (Otext); Container.appendchild (ODIV); ODiv.style.id = "Div_" +i; ODiv.style.width = "100px"; ODiv.style.height = "20px"; ODiv.style.backgroundColor = "#eee"; Alert (new date-stadate); } </script> </HEAD> <BODY> <div id= "container" ></div> <input type= "button" Value= "St Art "onclick=" Init (); "/> </body> </HTML>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
InnerHTML:
<textarea id="runcode13138"><! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" > <HTML> <HEAD> <TITLE> New Document &L t;/title> <meta name= "generator" content= "EditPlus" > <meta name= "Author" content= "" > <meta NAME= "Key Words "content=" "> <meta name=" Description "content=" "> <script type=" text/javascript "> Function init () {var stadate = new Date (); var doc = window.document; for (Var i=0;i<100;i++) {var str= "<div id= ' div_ '" +i+ "' >test</div>"; container.innerhtml + + str; Alert (new date-stadate); } </script> </HEAD> <BODY> <div id= "container" ></div> <input type= "button" Value= "St Art "onclick=" Init (); "/> </BODY> </HTML></textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Current 1/3 page
123 Next read the full text