title: How to return the index of a nodelist using vanilla js?
body: <p>I have something that I would like to convert from jquery to js.</p>
  
  <p>I am using js to create 12 li elements which when clicked gets the index number, in jquery I used the .index() function to achieve this,  </p>
  
  <pre><code>var month = $(".calenderApp__calender__allMonths__month"),
      startMonth;
  
  $(month).on('click', function () {
      startMonth = $(this).index() + 1;
  });
  </code></pre>
  
  <p>How would I do this is vanilla js, I have gotten as far as </p>
  
  <pre><code>var month = document.querySelectorAll(".calenderApp__calender__allMonths__month"),
      startMonth;
  
  for (var i=0; i&lt;month.length; i++) {       
      month[i].addEventListener("click", function () {
          startMonth = this; //returns full html element, just need index number
      });
  }
  </code></pre>