title: javascript equivalent of jquery for this function
body: <p>In a dinamically generated "ol" :</p>
  
  <pre><code>document.getElementsByTagName('ol');
      for (i = 0; i &lt; len; i++){
            var newLi = document.createElement("li");
            var link = document.createElement('a');
            link.href = "#"; 
            link.innerHTML = (results.rows.item(i).location + "-" + results.rows.item(i).datte);
            newLi.appendChild(link);
            olnew[0].appendChild(newLi);
  </code></pre>
  
  <p>i need find the "li" clicked, i use jquery library only for this function, i am searching for the same functionality in javascript, but at momento i have not idea how i can code it. thx
      var ss;
      ss=$("#idfromOl");
      ss.click(clickhecho);</p>
  
  <pre><code>}
  
  function clickhecho()
  {
      var $all_lis = $('li');
  
      $all_lis.on('click', function() {
          var index = $all_lis.index(this);
      });
  }
  </code></pre>