title: Select common parent/ancestor of nested elements with jQuery and CSS Selector
body: <p>I am looking to select the common parent of multiple nested elements for which I only know the inner text.</p>
  
  <p>For example, in the following code:</p>
  
  <pre><code>&lt;unknown&gt;       
      &lt;unknown class="unknown"&gt;
          ....
          &lt;unknown&gt;
              &lt;unknown&gt;Sometext&lt;/unknown&gt;
          &lt;/unknown&gt;
          &lt;unknown&gt;
              &lt;unknown&gt;Sometext&lt;/unknown&gt;
          &lt;/unknown&gt;
          &lt;unknown&gt;
              &lt;unknown&gt;Sometext&lt;/unknown&gt;
          &lt;/unknown&gt;
          ....
      &lt;/unknown&gt;
  &lt;/unknown&gt;
  </code></pre>
  
  <p>I would like to get the closest element (common parent) that has class unknown in this scenario. I do not know the actual tags or class names. I only know that the nest element contains the "Sometext". I know this can be done through a loop using jQuery/Javascript, but is there a CSS selector that I can use with jQuery to find this? I tried using a combination of closest(), parents(), parentsUntil() but I can't seem to get to this element.</p>
  
  <p>Thank you!</p>