Answers for "javascript add external script"

80

import js in html

<script type="text/javascript" src="yourfile.js"></script>
Posted by: Guest on February-23-2020
2

javascript dynamicly include another js file

var script = document.createElement('script');
script.src = "https://www.examplesite/myscript.js";
document.head.appendChild(script);
Posted by: Guest on December-09-2020
10

linking a script .js

<script type="text/javascript" src="path-to-javascript-file.js"></script>
Posted by: Guest on March-08-2020
0

javascript add div

<div id="new">
<p id="p1">Tutorix</p>
<p id="p2">Tutorialspoint</p>
</div>
<script>
   var tag = document.createElement("p");
   var text = document.createTextNode("Tutorix is the best e-learning platform");
   tag.appendChild(text);
   var element = document.getElementById("new");
   element.appendChild(tag);
</script>
Posted by: Guest on September-13-2020
1

how to include external javascript in html

<script src="script.js">
Posted by: Guest on September-18-2020

Browse Popular Code Answers by Language