title: getElementsByClassName not returning length
body: <p>I want to get the <code>length</code> of the returned class names  </p>
  
  <p>There are a series of buttons that I want to add event listeners to and they all share the same class name.  </p>
  
  <p><code>removeButton = document.getElementsByClassName("removeButton");</code>  </p>
  
  <p>When I do <code>removeButton.length</code> I always get <code>0</code> but if I do:  </p>
  
  <p><code>console.log(removeButton)</code> I can see the list of items there.  </p>
  
  <p>I need the length so I can iterate through a <code>for-loop</code> and assign the event listeners.  </p>
  
  <p>What seems to be the problem?  </p>
  
  <p><strong>Solution</strong><br>
  Check that the elements exist before trying to gather them with getElementsByClassName</p>