title: How can i make the clear button work properly on this code?
body: <p>I’m trying to do a simple program to fill some divs and I need a reset button to be able to clear all divs filled with content, so the user could input on divs all over again.
  Here is my code:</p>
  <pre><code>
  // **reset function**:
  const clearAll = document.getElementsByClassName(&quot;clear&quot;);
  clearAll.addEventListener('click', clearCells);
  
  function clearCells(){
    for (let i = 0; i &lt; cells.length; i++){
      cells[1] = &quot;green&quot;;
    }
  }
  </code></pre>
  <p>Sorry for the noob question, still trying to figure some things out.</p>