what would happen if I were to try and give a script tag an ID and remove it
Yes, you can add id attribute to your script tag -
<script id='jq' src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js'></script>
when you try to remove script tag using id #jq
, that script tag will be removed from DOM
Demo
http://jsfiddle.net/medTp/1/$(function(){
$('#jq').remove();
console.log($('html').html());
$('body').append('works');
});
You can see on console, that script tag is removed,
And the next two statement's make use of $
, so you can be sure that even if the tag is removed, the script is still there in memory.