I have a problem with my jQuery. So, I want to remove a script who is inside a <div>
.
My html is :
<div id="right-bloc">
<div class="right-bloc-pub-1">
<script type="text/javascript" src="http://firstScript.com"></script>
</div>
<div class="right-bloc-pub-2">
<script type="text/javascript" src="http://secondScript.com"></script>
</div>
</div>
My jQuery :
var stringOfHtml = '<script type="text/javascript" src="http://firstScript.com"></script>';
var html = $(stringOfHtml);
html.find('script').remove();
I want to remove the script witch contains http://firsttScript.com
, but not working. It's possible to remove this script and add after? Because I need to refresh this script