title: JS eventListener click disappearing
body: <p>I created simple <a href="https://jsfiddle.net/0nm4uLvd/" rel="noreferrer">fidlle</a></p>
  
  <pre><code>var cnt = 1;
  function add() {
      var root = document.getElementById('root')    
      root.innerHTML += '&lt;br /&gt;&lt;a id= "a_' +cnt + '" href="#"&gt;click&lt;/a&gt;'
      var a = document.getElementById("a_"+cnt)
      a.addEventListener('click', function(event) {
          alert('click:a_'+cnt)
      })
      cnt++
  }
  </code></pre>
  
  <p>When Add button is clicked once new link is added and after clicking on this link alert appears. </p>
  
  <p>When more links are added with Add button only the last link works(others does not have click event listener according to devel tools).</p>
  
  <p>Why does only the last link work and how can I make all links working?</p>