Skip to main content

Bug Tracker

Side navigation

#4691 closed bug (invalid)

Opened May 27, 2009 06:41PM UTC

Closed November 19, 2010 06:44AM UTC

Last modified March 15, 2012 04:10PM UTC

$('<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:
Description

$('<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 (0.6 KB) - added by dmethvin October 19, 2009 01:15AM UTC.

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

Change History (2)

Changed October 19, 2009 01:16AM UTC by dmethvin comment:1

component: buildcore
need: Test CasePatch

Changed November 19, 2010 06:44AM UTC by snover comment:2

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