title: jQuery: Can't select just appended element
body: <p>This is what happens on event: </p>
  
  <pre><code>$('div#pages').append($('&lt;div class="page" id="test"&gt;...&lt;/div&gt;'));
  </code></pre>
  
  <p>And then, on another event it fails doing this:</p>
  
  <pre><code>var page = $('div.page#test'); // returns empty array
  </code></pre>
  
  <p>I've debugged, and the appended html appears in the document structure after appending, but fails to get selected. Doing the same in browser console works perfectly.<br>
  What could be the problem?</p>