Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11675 closed bug (patchwelcome)

.add method in IE breaks when pass an HTMLCollection

Reported by: jstrimpel@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

When form.elements is passed to .add() in IE it has a a nodeType of 1, so add() treats it as a single DOM element not a collection of DOM elements. When it treats it as a single DOM element .add() wraps the collection in an array. The end result is an array containng one item which is an array like object (HTMLCollection). See it in action, http://jsfiddle.net/w7qNc/2/.

Change History (2)

comment:1 Changed 7 years ago by jstrimpel@…

Minor correction, IE8. I haven't tested earlier versions of IE. IE9 seems to be OK.

comment:2 Changed 7 years ago by gibson042

Resolution: patchwelcome
Status: newclosed

Support for array-like handling of form.elements was dropped last year for lack of a reliable way to differentiate it from form. See #6867 & #2114.

Note: See TracTickets for help on using tickets.