title: JavaScript: How to get parent element by selector?
body: <p>Example:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div someAttr=&quot;parentDiv. We need to get it from child.&quot;&gt;
      &lt;table&gt;
          ...
          &lt;td&gt; &lt;div id=&quot;myDiv&quot;&gt;&lt;/div&gt; &lt;/td&gt;
          ...
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I want to get the parent by some selector from the inner div element (the one with the <code>myDiv</code> class).</p>
  <p>How do I achieve that with plain JavaScript, <strong>without jQuery</strong>?</p>
  <p>Something like:</p>
  <pre class="lang-js prettyprint-override"><code>var div = document.getElementById('myDiv');
  div.someParentFindMethod('some selector');
  </code></pre>