Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#12318 closed bug (invalid)

Input element with id="nodeType" causes trouble in event-callbacks

Reported by: klaascuvelier <cuvelierklaas@…> 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.

Change History (2)

comment:1 Changed 11 years ago by Rick Waldron

Resolution: invalid
Status: newclosed

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 the nodeType of a DOM node. As you noted, the fix is to change the id

comment:2 Changed 9 years ago by dmethvin

#14771 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.