I am appending a child element with a reference to at javascript and a stylesheet, but I would like to delete it again when there is no use of it anymore.
var head = document.getElementsByTagName('head')[0];
// We create the style
var style = document.createElement('link');
style.setAttribute("rel", "stylesheet");
style.setAttribute("type", "text/css");
style.setAttribute("href", '_css/style.'+app+'.css');
var script = document.createElement('script');
script.setAttribute("type", "text/javascript");
script.setAttribute("src", '_scripts/_js/script.'+app+'.js');
// And the append the style
head.appendChild(style);
head.appendChild(script);
This is how I append the scripts and it works perfectly.. But I can't figure out how to delete the tags again from the head tag in HTML.
Does anybody know how to remove the tags from the header tag again.. I have been searching all around Stackoverflow but nobody actually seem to have this kind of problem, but if anybody knows there is another question answering this, please tell me..