Not able to capture parent object
<p>I'm trying to capture the <code>id</code> attribute on the parent here, and It returns as <code>undefined</code></p>

<pre><code>&lt;table&gt;
  &lt;tr id="1343"&gt;
    &lt;td&gt;&lt;span class="hi"&gt;Hi&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Javascript:</p>

<pre><code>var $id = $(".hi").parent("tr").attr("id");
alert($id); 
</code></pre>

<p>I thought I was using it right, but I guess not, anyone know why it won't give me the value I'm trying to get?</p>

<p>Here's a fiddle:
<a href="http://jsfiddle.net/AsDY6/" rel="nofollow">http://jsfiddle.net/AsDY6/</a></p>
