I'm working on a Chrome Extension and would like to have some part of the website's content be replaced.
So the website's HTML is: <div id="ad" class="ad-container "></div> they have multiple 'id', but the class name remains the same.
The code I want to replace it with is: <script src="link"></script>
I was looking into something called 'InnerHTML", and saw this example: document.body.innerHTML = document.body.innerHTML.replace('hello', 'hi'); but I'm not sure how to replace it with HTML, or change it so it works with a script tag.
Any help?