Bug Tracker

Opened 8 years ago

Closed 8 years ago

#10203 closed bug (worksforme)

Cannot create an input of type=number in jQuery 1.5 and 1.6.2 IE

Reported by: andreas.danielsson@… Owned by: andreas.danielsson@…
Priority: low Milestone: None
Component: manipulation Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


The following code consistently explodes in IE 9: $(document.createElement('input')).attr({ 'type': 'text' })

It does not generate a input with a type text

but if i use: $('<input type="text"></input>') it works.

You should look into it.

Change History (3)

comment:1 Changed 8 years ago by addyosmani

Owner: set to andreas.danielsson@…
Priority: undecidedlow
Status: newpending

Thanks for submitting a ticket to the jQuery bug tracker. Could you please comment back with a complete test case on jsFiddle.net reproducing the issue experienced?.

Also - I'm slightly confused with your ticket. In the title you mention creating inputs of type 'number', but the code you've supplied appears to just be working with inputs of type 'text'. Could you clarify which you're having trouble with?

Last edited 8 years ago by addyosmani (previous) (diff)

comment:2 in reply to:  1 Changed 8 years ago by anonymous


I am sorry for the titel, i just copy it and did not change it :)

After a few tests today, I have concluded that the clone object that causes it. it does not copy attributes so when you trying to find input element then you will not find jQuery input element and i consider that to be a bug.

Since jsfiddle.net not work in IE so I have put up a page and can be found here: http://spasm-design.com/jQuery/jQueryInputTest.htm

JsFiddle: http://jsfiddle.net/Sinful/NUgt3/

comment:3 Changed 8 years ago by addyosmani

Component: unfiledmanipulation
Resolution: worksforme
Status: pendingclosed

I've just tested your submitted test case (http://spasm-design.com/jQuery/jQueryInputTest.htm) through the following browsers:

IE7, 8, 9

Chrome 14, 15

Firefox 5, 6

and haven't been able to reproduce the issue described. Please be aware that clone() doesn't always perform what might be considered a deep clone of child elements such as select/option values, but other than that, inputs should work fine. Please double check your code. If you're able to supply another test case, we'll re-open.

Last edited 8 years ago by addyosmani (previous) (diff)
Note: See TracTickets for help on using tickets.