Side navigation
#3255 closed bug (fixed)
Opened August 15, 2008 12:02PM UTC
Closed December 25, 2008 07:48PM UTC
Last modified January 03, 2009 12:51AM UTC
$().attr does not work popperly with type
Reported by: | Licenser | Owned by: | flesler |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | core | Version: | 1.2.6 |
Keywords: | exception type input | Cc: | Licenser |
Blocked by: | Blocking: |
Description
When creating a new html element via $() using .attr() to set the type of the input causes a expection that type can't be changed.
var checkbox = $('<input/>'); checkbox.attr('type', 'checkbox'); // => exception
a workaround is:
var checkbox = $('<input type="checkbox"/>');
Attachments (3)
Change History (4)
Changed August 15, 2008 08:49PM UTC by comment:1
Changed August 16, 2008 03:06AM UTC by comment:2
owner: | → flesler |
---|---|
status: | new → assigned |
Changed December 25, 2008 07:48PM UTC by comment:3
cc: | → Licenser |
---|---|
resolution: | → fixed |
status: | assigned → closed |
Fixed at [5999].
Changed January 03, 2009 12:51AM UTC by comment:4
Landed a comprehensive fix in [6026].
The fix for this will probably appear in jQuery.clean(). Once appending the HTML string to that temporary div, parentNode will no longer return undefined and the throw will be executed: