title: jQuery doesn't work with elements created after document load
body: <p>I created two elements dinamically with jQuery:</p>
  
  <p>a picture
  and a Close button</p>
  
  <p>I wrote the code to remove both in doument.ready function:</p>
  
  <pre><code>$( ".deletepreview" ).click(function() {
      code = $(this).data("prevcode");
      $('#'+code).remove();
      $(this).remove();
  });
  </code></pre>
  
  <p>But it doesn't work, and I think this is because the code doesn't search in the code created after the document load.</p>
  
  <p>How can I solve this problem?</p>