Why can't I query an element that I just added via append()?
<p>Why can't I query an element that I just added via append()?</p>

<pre><code>$('body').append('&lt;div id="testing"&gt;&lt;/div&gt;');
if($("#testing").length == 0)
    alert("WTF!  Testing div should be there!");
</code></pre>

<p>Is there some kind of layout that doesn't happen until the JS finishes running or something?</p>

<p>How can I get around this?  Is there some other method that I could call to create dom elements to work with right away?</p>
