I want to remove a script element and replace it with a different one. Lets say that you
<html>
<head>
<script src="default.js">
</head>
What I want to do is remove default.js and replace it with new.js on the click of a button. I know you can create a script like this:
var new_scr=document.createElement('script');
new_scr.src="new.js";
document.getElementsByTagName('head')[0].appendChild(new_scr);