JQMIGRATE: jQuery.fn.attr(selected) may use property instead of attribute - jQuery 1.9
JQMIGRATE: jQuery.fn.attr(selected) may use property instead of attribute - jQuery 1.9
WanderingZombie
Posts: 1Questions: 0Answers: 0
[code]$('select option[value="'+oSettings._iDisplayLength+'"]', nLength).attr("selected", true);[/code]
should be
[code]$('select option[value="'+oSettings._iDisplayLength+'"]', nLength).prop("selected", true);[/code]
When using jQuery 1.9. jQuery Migrate 1.0.0 plugin, the following message is issued when .attr("selected", true) is used:
"JQMIGRATE: jQuery.fn.attr(selected) may use property instead of attribute"
should be
[code]$('select option[value="'+oSettings._iDisplayLength+'"]', nLength).prop("selected", true);[/code]
When using jQuery 1.9. jQuery Migrate 1.0.0 plugin, the following message is issued when .attr("selected", true) is used:
"JQMIGRATE: jQuery.fn.attr(selected) may use property instead of attribute"
This discussion has been closed.
Replies
[code]
$('select', nLength).val( oSettings._iDisplayLength );
[/code]
however, it does now. Change committed and it will be in the next release.
Thanks,
Allan