Ticket #3113 (closed bug: duplicate)
unexpected attr behavior on form with input element named 'action'
|Reported by:||rryan||Owned by:||flesler|
Given the following form:
<form action="someaction"> <input type="hidden" name="action" value="somevalue"/> </form>
If you have the dom element for the form, 'f'.
f.action = "foo", sets the value of the input element, not the action attribute on the form.
f.setAttribute("action","foo") sets the action attribute on the form tag.
In jQuery, if you say $("#form").attr("action","foo"), it actually sets the input element named action to 'foo', instead of setting the attribute on the form tag. Is this a bug? 'attr' would seem to imply the functionality of 'setAttribute', not this magic 'action' accessor on the dom element.
Thanks for all your hard work!
- need changed from Review to Patch
- Owner set to flesler
- Status changed from new to assigned
comment:12 Changed 5 years ago by rwaldron
- Priority changed from minor to low
- Status changed from assigned to closed
- Resolution set to duplicate