If you tried to load scripts into a page using innerHTML on HTML element like div it will not be executed.
The alert statement in below code will not be executed since it is set as inner HTML.
document.getElementById('divTemp').innerHTML = "<scr" + "ipt>alert('hi')</scr" + "ipt>";
You can use eval() but there is an easier and better way to do this. That is to load the script element into DOM.
Here is an example -
var script1 = document.createElement("script");
script1.innerHTML = "alert('hi');";document.body.appendChild(script1);
Live example in codepen-