Check if element exists
<blockquote>
  <p><strong>Possible Duplicates:</strong><br>
  <a href="http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery">Is there an &ldquo;exists&rdquo; function for jQuery</a><br>
  <a href="http://stackoverflow.com/questions/4257906/jquery-determining-if-element-exists-on-page">jQuery determining if element exists on page</a>  </p>
</blockquote>



<p><code>if(tr)</code> is returning true when tr is not an element, how do I check whether it's an element that exists?</p>

<pre><code>var tr = $('#parts-table .no-data').parent();
$('.delete', row).bind('click', function (e) {
  that.delete(e.currentTarget);
});
console.log(tr);
if (tr) //returns true when it shouldn't
</code></pre>
