As the previous reply stated, there is no attribute "form" on the input element, but there is a "form" property on the input object which can be used to identify the form which the input is an ancestor of. If you need the form object in your example, all you need to do is select it using $('#myForm'), or if you need to get it from the input, you could use $('#a').parent('form')[0] (I'm sure there must be a better way of doing this...)
[EMAIL PROTECTED] 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? > > -- View this message in context: http://www.nabble.com/attr%28%27form%27%29-not-work-in-firefox-tp17309906s27240p17313705.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.