Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <center>
- Enter # Times To Run Code:<br>
- <input type="textbox" id="text" scollbars="enabled"></input><br>
- Enter Javascript To Run:<br>
- <input type="textbox" id="textt" scollbars="enabled"></input><br>
- <button onclick="testFunc()">Load Muliple JS Lines In DOM</button><p>
- <script>
- function testFunc() {
- var out= text.value;
- var scr= textt.value;
- for(var i=0;i<out;i++){
- var x =document.createElement("SCRIPT");
- x.type= "text/javascript";
- x.text= (""+scr);
- document.head.appendChild(x);
- //document.innerHTML=(x.text);
- }
- }
- </script>
- </center>
Advertisement
Add Comment
Please, Sign In to add comment