Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14667 closed bug (duplicate)

$('form').prop("tagName") won't return correct tag name

Reported by: wenxuan.mo@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

For an HTMLFormElement, prop("tagName") won't return "form" if it has a child whose name property is "tagName", it returns this child node (object HTMLInputElement) instead.

demo: http://jsfiddle.net/rwaldron/da3nM/ details&discuss: http://stackoverflow.com/questions/20889098/a-js-exception-caused-by-form-element

Change History (4)

comment:1 Changed 6 years ago by wenxuan.mo

Sorry for the wrong demo link, here it is: http://jsfiddle.net/alansalexer/2gV3v/

Last edited 6 years ago by wenxuan.mo (previous) (diff)

comment:2 Changed 6 years ago by dmethvin

Same thing happens with plain DOM though.

http://jsfiddle.net/dmethvin/2gV3v/1/

Please read this, especially item 1: http://kangax.github.io/domlint/

comment:3 in reply to:  2 Changed 6 years ago by anonymous

Replying to dmethvin:

Same thing happens with plain DOM though.

http://jsfiddle.net/dmethvin/2gV3v/1/

Please read this, especially item 1: http://kangax.github.io/domlint/

yeah, thanks for sharing the domlint. I agree that technically this is not a bug with jQuery, but it would be much better if jQuery can fix this up so that I can use jQuery selector and prop() function to avoid conflicts using plain DOM.

comment:4 Changed 6 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #10891.
It would be great if we could fix everything, but unfortunately we can't.

Note: See TracTickets for help on using tickets.