Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9437 closed bug (invalid)

prop('method) performed on a form element returns a bunch of elements that are named "method"

Reported by: davidtwtong@… Owned by: Timmy Willison
Priority: high Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:


See demo: http://jsfiddle.net/davidtong/HFfTP/2/

prop('method') should be an empty string, but in reality (jQuery 1.6.1) it returns the three input elements named "method".

Change History (4)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfiledattributes
Owner: set to Timmy Willison
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 12 years ago by Timmy Willison

Resolution: invalid
Status: assignedclosed

This is how properties of a form are designed to work. If you'd like to retrieve the method attribute, use attr. http://jsfiddle.net/timmywil/HFfTP/3/

comment:3 Changed 12 years ago by Rick Waldron

@timmywil thanks for sorting that quickly, sorry for the false alarm.

comment:4 Changed 12 years ago by Timmy Willison

No problem. This is why forms get special treatment in IE when trying to retrieve and set their attributes. Even with get/setAttribute, IE6/7 will get and set the property instead.

Note: See TracTickets for help on using tickets.