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