title: Cannot set property 'width' of undefined
body: <pre><code>function size(){
  for(i=0; i&lt;squares; i++){
      document.getElementById('table').innerHTML += "&lt;div class='squareCell' id='objetive"+i+"'&gt;&lt;/div&gt;";
  }
  document.getElementsByClassName('squareCell').style.width="300px";
  document.getElementsByClassName('squareCell').style.height="300px";}
  </code></pre>
  
  <p>Still getting "Cannot set property 'width' of undefined" and dont know why. I'm not trying to just solve this, I want to learn what is exactly happening here.</p>
  
  <p>Greetings.</p>