New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery.removeProp("disabled") does not enable input after disabling with jQuery.prop("disabled", true) #2913

Closed
marques-work opened this Issue Feb 9, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@marques-work

I recently upgraded to 2.2.0 from 1.9.1, and I noticed this change in behavior.

var input = $("<input type='text'/>");
console.log(input.is(":disabled")); // false, as we would expect

input.prop("disabled", true);
console.log(input.is(":disabled")); // true

input.removeProp("disabled");
console.log(input.is(":disabled")); // expected: false, actual: true

// input.prop("disabled", false) or input.removeAttr("disabled") reenable the input
@dmethvin

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Feb 9, 2016

Member

http://api.jquery.com/removeprop/

Note: Do not use this method to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use .prop() to set these properties to false instead.

Member

dmethvin commented Feb 9, 2016

http://api.jquery.com/removeprop/

Note: Do not use this method to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use .prop() to set these properties to false instead.

@dmethvin dmethvin closed this Feb 9, 2016

@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.