Skip to main content

Bug Tracker

Side navigation

#12458 closed bug (wontfix)

Opened September 04, 2012 04:51PM UTC

Closed September 04, 2012 06:13PM UTC

Error in IE8 when asigning property with prop() method

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:
Description

Here is a fiddle: http://jsfiddle.net/Q9YDq/2/

Line in JQuery, that causes error:

return ( elem[ name ] = value );

This one seem to fail in JQuery since 1.7.1 at least

<<HTML<<

<input type="text" id="check"/><br/>

<input type="button" value="crash IE8!">

<<JS<<

$('input[type=button]').click(function(){

$('#check').val(5).prop('type', 'hidden');

});

Attachments (0)
Change History (1)

Changed September 04, 2012 06:13PM UTC by timmywil comment:1

component: unfiledattributes
priority: undecidedlow
resolution: → wontfix
status: newclosed

The .attr() method can be used to set the content attribute on element creation, but type cannot be set in IE once the element has been created. If you were to use .attr(), jQuery simply throws an error in all browsers. Whether we do this in .prop() is debatable. I prefer to keep .prop() raw and low-level and rely on the user to know how to manipulate properties because there are exponentially more factors in dealing with properties.