Unless I'm completely misunderstanding something here, that code should not
"work" in any browser.  There is no "form" attribute on an <input />
element.  What are you actually trying to accomplish?


On Sun, May 18, 2008 at 8:22 PM, wrote:

>
> This is my html:
> <form id="myForm" action="">
> <input type="text" id="a" />
> </form>
> and javascript:
> <script type="text/javascript>
> $(document).ready(function() {
>    var form = $('#a').attr('form');
>    alert(form.attr('action'));
> });
> </script>
> it works in IE 7.0, but in FF form is 'undefined', I can get the form
> using
> var form = $('#a').get(0).form;
>
> so why attr('form') does not work in firefox?
>

Reply via email to