5
I have the following line in my code:
$('#infs').removeAttr('required');
And when using the plugin jQuery Migrate, get the following Warning in debug:
JQMIGRATE: jQuery.fn.removeAttr no longer sets Boolean properties: required
5
I have the following line in my code:
$('#infs').removeAttr('required');
And when using the plugin jQuery Migrate, get the following Warning in debug:
JQMIGRATE: jQuery.fn.removeAttr no longer sets Boolean properties: required
4
According to the page of warnings jQuery Migrate 3.0 plugin+
JQMIGRATE:
jQuery.fn.removeAttr
no longer sets boolean propertiesCause: Before jQuery 3.0, the use of
.removeAttr()
in an attribute boolean, aschecked
,selected
orreadonly
would also define the corresponding property as false. This behavior was needed for older versions of Internet Explorer, but not correct for modern browsers because the attribute represents the value initial and property represents current value (dynamic).Solution: almost always wrong to use
.removeAttr("checked")
in a element of the GIFT. The only time it can be useful is if the GIFT is later serialized back into an HTML string. In all other cases, should be used.prop("checked", false)
.
Therefore, the code below should solve:
$('#infs').prop('required', false);
Browser other questions tagged jquery
You are not signed in. Login or sign up in order to post.
«depreciated» in English is «depreciated» and not «deprecated». The word «deprecated» that would be correct to refer to this would be translated as «obsolete», «disapproved», «censured»
– Guilherme Nascimento