Opened 11 years ago
Closed 11 years ago
#11916 closed bug (cantfix)
Adding a button type="button" .. element in iE8 + iE7 compatibility mode doesnt set the type attribute in jQuery 1.5+
Reported by: | 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:
Change History (2)
comment:1 Changed 11 years ago by
Component: | unfiled → manipulation |
---|---|
Keywords: | ie7 ie8 added |
Priority: | undecided → low |
Status: | new → open |
comment:2 Changed 11 years ago by
Resolution: | → cantfix |
---|---|
Status: | open → closed |
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.
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.