Skip to main content

Bug Tracker

Side navigation

#5660 closed bug (invalid)

Opened December 15, 2009 02:34PM UTC

Closed December 16, 2009 12:41AM UTC

$.extend does not copy own property of form element

Reported by: telensky Owned by:
Priority: major Milestone:
Component: core Version: 1.3.2
Keywords: extend Cc:
Blocked by: Blocking:

If I assign property 'form_idx' to the form element and then use $.extend(), the property is not copied!

See testcase available at

I would expect the secold alert to say that form_idx is 123.

The snip of the code:

var fe = $('form').get(0);

fe.form_idx = 123;

alert('this.form_idx == ' + fe.form_idx + ', OwnProperty == ' + fe.hasOwnProperty('form_idx'));

b = $.extend({}, fe);

alert('b.form_idx == ' + b.form_idx); // how comes that this is undefined!!!

Attachments (0)
Change History (1)

Changed December 16, 2009 12:41AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed
is not meant to copy or extend DOM elements. If you want to make a copy of a DOM element, use
and not
. IE in particular doesn't treat a DOM element the same as a Javascript object.