title: jQuery detecting non-existent element
body: <p>I have a function that checks to see if an img tag is inside of a figure element with a class of "colorbox", and if it is, to add some additional styling to some elements. However, the function still runs even if there are no images in the colorbox figure and I don't know why.</p>
  
  <p>My jQuery looks like this</p>
  
  <pre><code>jQuery(document).ready(function($){
    if ($(".colorbox").has("img")) {
       ~code here~
    }
  }
  </code></pre>
  
  <p>And here is the colorbox figure, clearly without an img element...</p>
  
  <pre><code>&lt;figure class="colorbox"&gt;
    &lt;ficaption&gt;
      &lt;h2&gt;&lt;/h2&gt;
      &lt;p&gt;&lt;/p&gt;
      &lt;p&gt;&lt;/p&gt;
    &lt;/figcaption&gt;
  &lt;/figure&gt;
  </code></pre>
  
  <p>So why would jQuery be picking up an element that doesn't exist?</p>