title: javascript changing text of multiple elements while hovering only one element
body: <p>Having an issue with replacing text in multiple elements while hovering only one element</p>
  
  <p>I tried doing <code>document.getElementsbyClassName()</code> but it didnt seem to work</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>function replace(text) {
    var display = document.getElementById('head');
    display.innerHTML = "";
    display.innerHTML = text;
  }
  
  function revert(text) {
    var display = document.getElementById('head');
    display.innerHTML = "";
    display.innerHTML = text;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h2 id="head" onmouseover="replace('oh no!! the heading is gone')" onmouseout="revert('e8')"&gt; e8 &lt;/h2&gt;
  &lt;p id="pp"&gt; :) &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I can replace the header but not the paragraph.</p>