title: jQuery select dynamically created html element
body: <p>There are a lot of asked questions with almost similar titles with this question of mine, but you know I didn't find an answer.<br><br>
  My simple question is: 
  I have button, when I click on it, javascript creates modal window<br><br></p>
  
  <pre><code>&lt;div class="aui-dialog"&gt;
       html here... 
       &lt;button id="closeButton"&gt;Close&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>just after <code>&lt;body&gt;</code> tag.<br><br> 
  I can bind click event of close button with no problem using jQuery <strong>live</strong>: </p>
  
  <pre><code>$("#closeButton").live("click", function() { 
      alert("asdf"); // it calls
      $("body").find(".aui-dialog").remove();
  });
  </code></pre>
  
  <p><strong>My problem is</strong>, I cannot select that dynamically created modal window div by its classname. So that I could call jQuery .remove() method to make close action. Now I know, I must deal with dynamic elements in another way.<br><br>
  What way?</p>
  
  <p><strong>EDIT:</strong><br>
  <em>I think it's important to mention this:</em> <br>
  I dont' create the modal window myself, I use <a href="http://en.wikipedia.org/wiki/Liferay" rel="noreferrer">liferay</a> portal. It has built-in javascript framework <strong>AUI</strong>(<a href="http://ru.wikipedia.org/wiki/Yahoo!_UI_Library" rel="noreferrer">YUI</a>) that creates that modal window. I can just create that close button inside it in its view.</p>
  
  <p><strong>EDIT 2:</strong><br>
  Modal window div class attribute value is: "<em>aui-component aui-panel aui-dialog aui-widget-positioned</em>"</p>