title: How to find parent form from element?
body: <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>It should be something really simple.... Thanks in advance</p>