Skip to main content

Bug Tracker

Side navigation

#10203 closed bug (worksforme)

Opened September 05, 2011 09:06AM UTC

Closed September 06, 2011 04:56PM UTC

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

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

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.

Attachments (0)
Change History (3)

Changed September 06, 2011 10:18AM UTC by addyosmani comment:1

_comment0: 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've having trouble with?1315326431448907
owner: → andreas.danielsson@mogul.com
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?

Changed September 06, 2011 04:23PM UTC by anonymous comment:2

Hi,

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/

Changed September 06, 2011 04:56PM UTC by addyosmani comment:3

_comment0: I've just tested your submitted test case (http://spasm-design.com/jQuery/jQueryInputTest.htm) through the following browsers: \ \ IE7, 8 \ Chrome 14, 15 \ Firefox 6 \ \ and haven't been able to reproduce the issue described. Please beware 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.1315328231022816
_comment1: 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 6 \ \ and haven't been able to reproduce the issue described. Please beware 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.1315328321006632
_comment2: 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 6 \ \ and haven't been able to reproduce the issue described. Please beware 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.1315335212292354
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.