title: In javascript innerhtml.replace function is not working
body: <p>I have below code and i am trying to replace regex with another text but it is not working any suggestion what. i am doing wrong?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const regex = /\?/g;
  
  let p = document.querySelectorAll('.test');
  
  p.forEach((pa) =&gt; {
      pa.style.color = 'red';
      pa.innerHTML.replace(regex, 'test');
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;Document&lt;/title&gt;
  &lt;/head&gt;
  
  
  &lt;body&gt;
      &lt;p class="test"&gt;This one was, hopefully, quite straightforward although? it did get a bit more complicated as a? previous exercise had created multiple paragraph tags on the page. It’s a good bit of string! manipulation practice too.Got your own solution for this?;&lt;/p&gt;
  &lt;/body&gt;
  &lt;script src="app2.js"&gt;&lt;/script&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>