Ticket #1513 (closed bug: duplicate)
$('<input/>').attr() failure in IE6
| Reported by: | uence | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.1.2 |
| Component: | core | Version: | 1.1.4 |
| Keywords: | ie6 | Cc: | |
| Blocking: | Blocked by: |
Description
The code below fails in IE6 with the error:
"This command is unsupported."
at line 562 of jquery-latest.js v.1.1.3.1
$('<input/>')
.attr({
type:'submit',
name:'cancel',
value:'Start over',
className:'button',
autocomplete:'off'})
The issue seems to be with adding attributes using the method above to the INPUT element.
Change History
comment:2 Changed 6 years ago by arrix
In IE, we can change the type attribute of an <input> created by document.createElement, but not one created by wrapper.innerHTML = '<input/>'.
This is an odd in IE. Should jQuery fix it?
comment:3 Changed 6 years ago by shameister
Same problem like http://dev.jquery.com/ticket/1359
jQuery will not fix this. Documentation available at: http://docs.jquery.com/Core#.24.28_html_.29
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

$(document.createElement('input'))[0].type = 'submit';works fine but
$('<input/>')[0].type = 'submit';fails with "This command is unsupported" error.