title: Getting access to a jquery element that was just appended to the DOM
body: <p>I am simply appending an element that is on the DOM like:</p>
  
  <pre><code>$("#div_element").append('&lt;a href="#"&gt;test&lt;/a&gt;');
  </code></pre>
  
  <p>Right after I append it I need access to the element I just made in order to bind an click function to it, I tried:</p>
  
  <pre><code>$("#div_element").append('&lt;a href="#"&gt;test&lt;/a&gt;').click(function(){alert("test")});
  </code></pre>
  
  <p>But the above didn't work. I could uniquely id the element but that seems like a bit to much work when perhaps there is a way I can get the element right after I append it.</p>