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: | 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:
If you change the name="nodeType" attribute to any other value, then it works.
Change History (3)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
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
Resolution: | → duplicate |
---|---|
Status: | new → closed |
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.
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.