How to find the corresponding th to a given td?
<p>Basically the same question as <a href="https://stackoverflow.com/q/3523770/1524913">How can I get the corresponding table header (th) from a table cell (td)?</a> but not jQuery specific.</p>

<p>From a given <code>&lt;td&gt;</code> is there an easy way to find the corresponding <code>&lt;th&gt;</code>?</p>

<pre><code>    &lt;table width="100%" id="stock"&gt;
        &lt;tr&gt;
            &lt;th&gt;Name&lt;/th&gt;
            &lt;th&gt;Type&lt;/th&gt;
            &lt;th&gt;Quantity&lt;/th&gt;
            &lt;th&gt;Options&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;foo&lt;/td&gt;
            &lt;td id="target"&gt;bar&lt;/td&gt;
            &lt;td&gt;-1&lt;/td&gt;
            &lt;td&gt;...&lt;/td&gt;
        &lt;/tr&gt;
</code></pre>

<p>I'd like something doing this:</p>

<pre><code> document.getElementById('target').correspondingTH // would return HTMLObject &lt;th&gt;Type&lt;/th&gt;
</code></pre>

<p>An ideal answer might contain both a jQuery way to do it and a vanilla one but I'm personally looking for a vanilla one.</p>