title: Access new generated content in jQuery
body: <p>In all the research I have found, they invoke binding an even to the element with .on(), but that not what I need. Here is a brief example:</p>
  
  <pre><code>&lt;div id="myElement"&gt;
      &lt;ul id="myUl"&gt;
          &lt;li&gt;content list 1&lt;/li&gt;
          &lt;li&gt;content list 2&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>After an ajax call, I replace the content of myElement using:</p>
  
  <pre><code>var div = $("#myElement");
  div.replaceWith('&lt;div id="myElement"&gt;
      &lt;ul id="myUl"&gt;
          &lt;li&gt;new content list 1&lt;/li&gt;
          &lt;li&gt;new content list 2&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;');
  </code></pre>
  
  <p>Now if I want to access the unordered list to add for example a class name: <code>div.find("ul").addClass("myClass");</code> it doesn't work. Any idea how to solve this?</p>