title: jQuery find not working in top-level elements if not added to DOM
body: <p>I'm loading some HTML with jQuery asynchronously:</p>
  
  <pre><code>$.get(path, {}, function (data) {
      var result = $(data);
      var resultSelector = result.find(selector);
  });
  </code></pre>
  
  <p><code>result</code> is a valid HTML <em>that contains</em> my selector (in my specific case, <code>"#UsersAndRolesResults"</code>).</p>
  
  <p>I can see that it contains when I simply type <code>result</code> into the console, it's <em>there</em> exactly with the same ID, no typos or anything.</p>
  
  <p>However, <code>result.find(selector)</code> returns 0 elements. </p>
  
  <p>In my specific example, this is <code>result</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/f06Qd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/f06Qd.png" alt="enter image description here"></a></p>
  
  <p>And: </p>
  
  <p><a href="https://i.stack.imgur.com/rs98Q.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rs98Q.png" alt="enter image description here"></a></p>
  
  <p>Why?</p>
  
  <p><strong>UPDATE</strong>: I can query for <em>other elements that are inside <code>#UsersAndRolesResults</code> with their ID tag and they are returned correctly</em>. I also <em>cannot</em> query any other top-level elements in the result. I think there is an issue with querying top-level elements inside the result.</p>
  
  <p><strong>UPDATE 2:</strong> Just try <code>$('&lt;div id="target"&gt;&lt;/div&gt;').find("#target")</code> and you will get 0 results, where you should obviously get the <code>div</code>.</p>