How to find parent form from element?
<p>I am trying to find parent form from element using code below:</p>

<pre><code>&lt;form id="f1" action="action1.html"&gt;
form1 &lt;button id="btn1" onclick="testaction(this); return false;" &gt;test form 1&lt;/button&gt;
&lt;/form&gt;


&lt;script type="text/javascript" &gt;
function testaction(element) {
    var e = $(element.id);
    var form = e.parent('form');

    alert(form.id); // undefined!!
    alert(form.action); // undefined!!
    alert(document.forms[0].action); //http://localhost/action1.html
}
&lt;/script&gt;
</code></pre>

<p>Whole sample is available at <a href="http://dl.dropbox.com/u/5079317/HTMLPage1.htm" rel="nofollow">http://dl.dropbox.com/u/5079317/HTMLPage1.htm</a></p>

<p>It should be something really simple.... Thanks in advance</p>
