title: How to call a function when clicking a dynamically generated link, using jQuery?
body: <p>I am creating more than 1 <code>&lt;a href="#"&gt;&lt;/a&gt;</code> elements dynamically. The <code>id</code> attribute is also dynamically assigned. Like <code>&lt;a href="#" id='delete"+id+"'&gt;&lt;/a&gt;</code>. ID will becomes like <code>delete01, delete02, ...</code> I want to call a function when clicking any one of these element. I just know,</p>
  
  <pre><code>$("#someId").click(this.someFunction()); 
  </code></pre>
  
  <p>calls the function, when the element with the ID <code>someId</code> clicked. </p>
  
  <p>The generated HTML looks like,</p>
  
  <pre><code>&lt;a id="delete26" href="#" class="delete"&gt;Delete&lt;/a&gt;
  &lt;a id="delete27" href="#" class="delete"&gt;Delete&lt;/a&gt;
  &lt;a id="delete28" href="#" class="delete"&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p>The JavaScript code that generates the above html looks like,</p>
  
  <pre><code>html += "&lt;a class='delete' href='#' id='delete"+post.id+"'&gt;Delete&lt;/a&gt;";
  </code></pre>
  
  <p>Here, my ID's were dynamically generated. So, how shall i call a function when any one of the element got clicked. </p>
  
  <p>Any suggestions!!!</p>
  
  <p>Thanks!</p>