title: js click on li added by script
body: <p>I click on &quot;My link1&quot;, i have the alert &quot;I clicked on&quot; -&gt; OK<br/>
  I click on button &quot;Add line&quot;,  it adds my link 2 -&gt; OK<br/>
  I click on &quot;My link2&quot; just added, nothing happens. -&gt; KO<br/></p>
  <p>Any help is welcome.</p>
  <p>This is my code</p>
  <pre><code>&lt;ul style=&quot;list-style-type: none;padding-left: 0px;&quot; id=&quot;listitems&quot;&gt;
    &lt;li &gt;&lt;a href=&quot;#&quot; id=&quot;mylink&quot;&gt;my link 1&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;button onclick=&quot;addrecepitem();&quot; id=&quot;btnrecepajouter&quot;&gt;Add line&lt;/button&gt;
  
  &lt;script&gt;
  function addrecepitem(){
  document.getElementById('listitems').innerHTML += '&lt;li id=&quot;mylink&quot;&gt;my link 2&lt;/li&gt;';
  }
  
  $('#mylink').click(function(){
  alert('I clicked on ');
  }
  
  &lt;/script&gt;
  
  </code></pre>