title: how to get the index of the li clicked in javascript
body: <p>Just using javascript, need to get the index of the li that's clicked with the following listener:</p>
  
  <pre><code>var ulList = document.getElementById('todo-list');
  
  ulList.addEventListener('click', function(e){
     if( e.target.nodeName == "BUTTON") {
  
     //IS THERE A WAY INSIDE HERE TO GET THE INDEX OF THE li clicked
         e.target.parentNode.remove(); 
     } 
  });
  </code></pre>
  
  <p>each li looks like:</p>
  
  <pre><code>&lt;li&gt;
     &lt;input type="checkbox" value="1" name="todo[]"&gt;
     &lt;span class="centerSpan" style="text-decoration: none;"&gt;abc&lt;/span&gt;
     &lt;button class="rightButton"&gt;X&lt;/button&gt;
  &lt;/li&gt;
  </code></pre>