how to create html tags in javascript code example
Example 1: javascript create script tag
var script = document.createElement("script");
script.src = "https://url.com/";
document.head.appendChild(script);
Example 2: how to add elements in javascript html
//adding 'p' tag to body
var tag = document.createElement("p"); // <p></p>
var text = document.createTextNode("TEST TEXT");
tag.appendChild(text); // <p>TEST TEXT</p>
var element = document.getElementsByTagName("body")[0];
element.appendChild(tag); // <body> <p>TEST TEXT</p> </body>