After loading the document the \n\g
has to be removed. I am trying with this code, for any text its working fine but for this characters \n\g
it's not working
$("document").ready(function() {
document.body.innerHTML = document.body.innerHTML.replace(/\n\g/g, 'n');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>here is that we are @ replacing "\n\g" "\n\g"
<div>here is that we are replacing</div>
</div>"\n\g"
<div>here is another @ that we are "\n\g" replacing</div>
<p>here is another @ that we are replacing</p>