Side navigation
#12318 closed bug (invalid)
Opened August 16, 2012 01:39PM UTC
Closed August 16, 2012 01:49PM UTC
Last modified February 24, 2014 03:21PM UTC
Input element with id="nodeType" causes trouble in event-callbacks
Reported by: | klaascuvelier <cuvelierklaas@gmail.com> | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you have an input element with id="nodeType" within a form, there are problems selecting the elements of that form from within the submit callback (and in other events).
Working testcase:
http://jsfiddle.net/klaascuvelier/ySth9/11/
I suppose the 'nodeType' attribute of html-elements can be the cause of this problem.
Tested in OSX, browers:
Firefox 14.0.1
Google Chrome 23.0
Google Chrome 21.0
Safari 6.0
This bug is also reproducable in earlier jQuery versions, on jsFiddle I tried with versions:
1.8.0, 1.7.2, 1.6.4, 1.5.2, 1.4.4, 1.3.2
Easy workaround is just changing the ID of the element.
nodeType
is a special cased property name used by the DOM, the best resolution here is to not use "nodeType" in your own code, unless you're using it to access thenodeType
of a DOM node. As you noted, the fix is to change the id