I googled my fingers wound and all the solutions I found won't work.
Im trying to replace a div like the following:
var modal = document.getElementById("first");
// Get modal content and replace the footer with content
var oldContent = modal.innerHTML;
// Set modal content
modal.innerHTML = oldContent.replace(/<div class="two">(.*?)<\/div>/, '<div class="two">' + 'Content' + '</div>');
<div class="outer" id="first">
<div class="one">This is the first one</div>
<div class="two">Second one</div>
</div>
Im trying to replace everything in the second div.
Currently my code is like this and I tried so select everything with regex, but it just wont work.