Skip to main content

Bug Tracker

Side navigation

#14667 closed bug (duplicate)

Opened January 03, 2014 01:55AM UTC

Closed January 05, 2014 02:24AM UTC

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

Reported by: wenxuan.mo@gmail.com 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

Attachments (0)
Change History (4)

Changed January 03, 2014 02:37AM UTC by wenxuan.mo comment:1

_comment0: http://jsfiddle.net/alansalexer/2gV3v/1388716796309561

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

Changed January 03, 2014 02:42AM UTC by dmethvin comment:2

Same thing happens with plain DOM though.

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

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

Changed January 03, 2014 09:23AM UTC by anonymous comment:3

Replying to [comment:2 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.

Changed January 05, 2014 02:24AM UTC by dmethvin comment:4

resolution: → duplicate
status: newclosed

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