Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14771 closed bug (duplicate)

jQuery.closest('form') doesn't work for input-elements with name="nodeType"

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:

Description

If there is any <input name="nodeType"/> in the DOM, the closest("form") and parents("form") methods doesn't work, i.e. the parent form-element is not found.

Try here:

http://jsfiddle.net/VCZ2m/2/

If you change the name="nodeType" attribute to any other value, then it works.

Change History (3)

comment:1 Changed 9 years ago by dmethvin

http://kangax.github.io/domlint/

If there's an easy workaround we can fix it, but I suspect the problem will just crop up somewhere else. Not sure if we can access nodeType when it's been clobbered by a form element name.

comment:2 Changed 9 years ago by rvidal

A similar previous case: http://bugs.jquery.com/ticket/12318

Following that logic, this should be marked invalid, although it's a really nasty corner case.

comment:3 Changed 9 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #12318.
I'm going to close this as a duplicate, but if anyone has a magic potion to avoid DOMLint-style bugs like this please let us know.

Note: See TracTickets for help on using tickets.