title: Get li element onclick with pure javascript without applying onClick to each element
body: <p>First of all I do not want to use jQuery, just pure javascript; please don't link to duplicate jQuery posts.</p>
  
  <p>If I have a list like</p>
  
  <pre><code>&lt;ul id="bulk"&gt;
      &lt;li id="one"&gt;&lt;/li&gt;
      &lt;li id="bmw"&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want to get the id of the clicked list element.
  I am aware I could add <strong>onClick=""</strong> to each element but the production list I have has 2000 entries and I think a better way exists.</p>
  
  <p><strong>For example:</strong></p>
  
  <p>If I had only one <code>li</code> element with <code>id='singular'</code> I could use the following javascript to get the ID clicked.</p>
  
  <pre><code>var li = document.getElementById('singular').onclick = function() { do something };
  </code></pre>
  
  <p>As there are thousands of <code>li</code> elements, this code won't work.</p>
  
  <p>I have been able to get a list of the element names with the following javascript:</p>
  
  <pre><code>var bulk = document.getElementById('bulk');
  var bulkli = tabs.getElementsByTagName('li');
  //bulkli contains ["one", "bmw"];
  </code></pre>
  
  <p>but this does not tell me which one was clicked.</p>