title: Replace content by class with JavaScript
body: <p>How can I modify the content with Javascript selecting the elements by class?</p>
  
  <p>Actually I tried using this:</p>
  
  <pre><code>document.getElementsByClassName("myClass").innerHTML = "new content"
  </code></pre>
  
  <p>But does nothing.
  If I select the element by ID it's work</p>
  
  <pre><code>document.getElementById("myID").innerHTML = "new content"
  </code></pre>
  
  <p>But I need can select by class.</p>
  
  <p>I only need to change the content inside a  tag. Replacing a text to an img element for a woocommerce buttons.</p>
  
  <p>Thanks!</p>