var scripts = document.getElementById("data").querySelectorAll("script");

for (var i = 0; i < scripts.length; i++) {
 if (scripts[i].innerText) {
 eval(scripts[i].innerText);
 } else {
 fetch(scripts[i].src).then(function(data) {
 data.text().then(function(r) {
 eval(r);
 })
 });

 }
 // To not repeat the element
 scripts[i].parentNode.removeChild(scripts[i]);
}
var script = document.createElement('script');
script.src = "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js";
script.integrity = "sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM";
script.crossOrigin = "anonymous";
document.head.appendChild(script);
Related Keywords: JS, Append To HTML, Append To HTML Body, No jQuery, Without jQuery