title: Unable to bind click event to an echoed element
body: <p>In JS I fire up a PHP script via XHR which is supposed to do:</p>
  
  <pre><code> if($update)
      echo "&lt;div class='popup'&gt;&lt;div&gt;(some text)&lt;/div&gt;&lt;/div&gt;.";
  
  echo "&lt;script&gt; $(document).ready(function() { $('.popup').bind('click', function() {   $('.popup').hide(); }); }); &lt;/script&gt;"
  </code></pre>
  
  <p>I think I've tried everything, but there's no way I can make <code>.popup</code> hide after click. Where should I put <code>.bind</code> handler for this to work?</p>