title: Get parent with certain class from child element
body: <p>I use jquery droppable.</p>
  
  <p>When I drop an element I get the element beneath the dropped element:</p>
  
  <pre><code>var elementBeneathDroppedElement = document.elementFromPoint(event.clientX, event.clientY);
  </code></pre>
  
  <p>BUT the elementBeneathDroppedElement is just a fragment of the whole div with MULTIPLE divs. It really depends where the user drops his element and what element I get back as the beneath dropped element.</p>
  
  <p>Thats the structure of a typical element on the container where I drop other elements:</p>
  
  <pre><code>&lt;div class="refOptionItem" &gt;
  
      &lt;div class="refOptionItemContent text-center text-uppercase" style="color: @Model.Item1.CssColor"&gt;
          &lt;div&gt;
              &lt;img src="@(Model.Item1.IconName)" alt="@Model.Item1.IconName" /&gt;
          &lt;/div&gt;
          &lt;div&gt;@Model.Item1.Name&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What I get is the image-tag but what I want is the top div with the class "refOptionItem".</p>
  
  <p>I tried this: </p>
  
  <pre><code>var topParentDiv = $('.refOptionItem', elementBeneathDroppedElement );
   // restrict to context is not correct I guess
  </code></pre>
  
  <p>How do you search for a parent with a certain class starting from the elementBeneathDroppedElement I have.</p>