title: jquery .closest() select itself when trying to access the closest upper div
body: <p>Hello Actually What I want is to hide the immediate upper div of an div element if it is empty</p>
  
  <p>So I written the code like this</p>
  
  <pre><code>if ($.trim($('#searchQuery').html()) == '') {
  
      $('#searchQuery').closest("div").css("display", "none");
  }
  </code></pre>
  
  <p>The element with the <code>id searchQuery</code> is itself is <code>div</code> so what it is doing it is hiding itself.</p>
  
  <p>Anybody know what to do in this case why its behavior is like this??</p>