I want to replace some words of the document without changing any html tags or js codes.
Basically what I do is;
document.body.innerHTML = document.body.innerHTML.replace('lorem','new lorem');
But this code will replace any 'lorem'. I want to avoid tags like; <script... var lorem = 123; <div class="lorem", <a id="lorem" etc.
How can I do this in JS?