I want to add DOM element to head section of HTML. jQuery does not allow adding DOM element script to the head section and they execute instead, Reference.
I want t
As per the author, they want to create a script in the head, not a link to a script file. Also, to avoid complications from jQuery (which provides little useful functionality in this case), vanilla javascript is likely the better option.
That may possibly be done as such:
var script = document.createTextNode("");
document.getElementsByTagName('head')[0].appendChild(script);