Skip to main content

Bug Tracker

Side navigation

#11916 closed bug (cantfix)

Opened June 15, 2012 01:57AM UTC

Closed July 25, 2012 02:17AM UTC

Adding a button type="button" .. element in iE8 + iE7 compatibility mode doesnt set the type attribute in jQuery 1.5+

Reported by: thetoolman@gmail.com Owned by:
Priority: low Milestone: None
Component: manipulation Version: git
Keywords: ie7 ie8 Cc:
Blocked by: Blocking:
Description

in iE8 + iE7 compatibility mode, when you create insert a <button type="button ... > element, jQuery no longer inserts the type="button" attribute. e.g.

$('<button type="button">button</button>').appendTo("div");

Prior to 1.5, JQuery did insert the type attribute correctly. Here is a minimal example:

http://jsfiddle.net/sCaJZ/10/

Attachments (0)
Change History (2)

Changed June 23, 2012 02:06PM UTC by dmethvin comment:1

component: unfiledmanipulation
keywords: → ie7 ie8
priority: undecidedlow
status: newopen

Confirmed. This only occurs in IE8 when running in IE7 Compatibility View. To do that you need to run IE8, go to the jsFiddle above, and click the broken-page icon to the right of the URL.

Changed July 25, 2012 02:17AM UTC by dmethvin comment:2

resolution: → cantfix
status: openclosed

I spent some time tracing this through. When the button HTML goes through .clean(), IE8 consistently strips off the type="button" attribute when it's applied to div.innerHTML. I tried using different wrapMap tags such as <form> but that didn't help.

You can see this is independent of jQuery with this incredibly simple test case, be sure to click the broken-page icon to get into IE7 compat mode: http://jsfiddle.net/Rsz5Q/

Nothing we can do here.

PUBLIC SERVICE ANNOUNCEMENT: Click the broken-page icon to leave IE7 compat mode before you leave the site!