Skip to main content

Bug Tracker

Side navigation

#11675 closed bug (patchwelcome)

Opened April 30, 2012 11:21PM UTC

Closed May 03, 2012 08:33PM UTC

.add method in IE breaks when pass an HTMLCollection

Reported by: jstrimpel@gmail.com 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/.

Attachments (0)
Change History (2)

Changed April 30, 2012 11:31PM UTC by jstrimpel@gmail.com comment:1

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

Changed May 03, 2012 08:33PM UTC by gibson042 comment:2

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.