title: JQuery function to Ajax created HTML?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9344306/jquery-click-doesnt-work-on-ajax-generated-content">jquery click doesnt work on ajax generated content</a>  </p>
  </blockquote>
  
  
  
  <p>The issue is that I need to perform a JQuery on click function to an <code>&lt;a&gt;</code> tag created from an Ajax get. I can't seem to find an answer that works for me.</p>
  
  <pre><code>$("#get_button").click(function (e) {
     $.ajax({
       type: 'GET',
       url: 'http://someurl.com/apikey=1234124124',
       dataType: 'jsonp',
       success: function (data) {
         newRow = "&lt;a id='some_id'&gt;test&lt;/a&gt;";
         $("#table_id").append(newRow);
       }
    });
  });
  $('#some_id').click(function (event) {
      event.preventDefault();
      alert('this will pop up if it worked');
  });
  </code></pre>
  
  <p>Edit for clarification: <strong>In my code there are multiple rows added with the id of some_id, I forgot to show that.</strong></p>