Bug Tracker

Opened 14 years ago

Closed 12 years ago

Last modified 11 years ago

#4691 closed bug (invalid)

$('<input />').attr('name', 'name') [IE bug]

Reported by: Arrviasto Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: input hidden IE8 IE7 attr Cc:
Blocked by: Blocking:


$('<input />').attr('name', 'name') method doesn't work on IE8 running in IE7 browser mode.

My code: var $inhid = $('<input />').attr('type','hidden'); var $posx = $inhid.clone().attr('name','x').val(x); var $posy = $inhid.clone().attr('name','y').val(y);

generates: <INPUT type="hidden" jQuery1243448158904="9" value="243" /><INPUT type="hidden" jQuery1243448158904="10" value="217" />

(missing name attribute)

I'm using Interface plugin (http://interface.eyecon.ro/), but in other parts of code (this is pure jQuery1.3.2)

Attachments (1)

test-4691.html (597 bytes) - added by dmethvin 13 years ago.
Test case for #4691; breaks in IE8 when in IE7-compat mode

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by dmethvin

Attachment: test-4691.html added

Test case for #4691; breaks in IE8 when in IE7-compat mode

comment:1 Changed 13 years ago by dmethvin

Component: buildcore
need: Test CasePatch

comment:2 Changed 12 years ago by snover

Resolution: invalid
Status: newclosed

Thanks for the report, but this is not a jQuery bug. IE7 and earlier do not allow users to dynamically set the name attribute of an input element at all. MSDN source

Note: See TracTickets for help on using tickets.