title: jQuery: selector question (closest)
body: <p>i'm having this markup:</p>
  
  <pre><code>&lt;div class=gui&gt;
      &lt;div class=form&gt;
          &lt;div class=textbox&gt;&lt;/div&gt;
          &lt;div class=textbox&gt;&lt;/div&gt;
          &lt;div class=textbox&gt;&lt;/div&gt;
          &lt;div class=selectbox&gt;&lt;/div&gt;
          &lt;div class=selectbox&gt;&lt;/div&gt;
          &lt;div class=button&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>what i want to do is iterate the divs and find their corresponding parents.
  like:</p>
  
  <p>textboxes > form</p>
  
  <p>selectbox > form</p>
  
  <p>button > form</p>
  
  <p>form > gui</p>
  
  <p>here's my jQuery selector: </p>
  
  <pre><code>var dParent = div.closest("div.form, div.gui");
  </code></pre>
  
  <p>it works nice for the text- and selectboxes, but not for the form.
  the strange thing is that the form reports itself as parent instead of the gui.</p>
  
  <p>any ideas what could be wrong?</p>
  
  <p>thanks</p>