title: Determine whether a jQuery selection is in the DOM
body: <p>I have a jQuery selection that either originated as a newly created element (e.g. <code>$("&lt;div/&gt;")</code>) and has no parent, or is actually an element in the DOM.</p>
  
  <p>What's the most efficient way to determine whether or not the selected element is actually in the current DOM tree?</p>
  
  <p>One possibility is to call <code>.parent()</code>, but I suspect there's a more efficient way.</p>