Reputation: 2925
How do you re-enable an element after disabling it this way?
$("#foo").attr("disabled", "disabled");
Upvotes: 1
Views: 78
Reputation: 2490
Assuming you're using a recent version of jQuery (1.6+), a more appropriate way of toggling the disabled
attribute is using .prop()
:
$("#foo").prop("disabled", true);
$("#foo").prop("disabled", false);
See jQuery API documentation for .prop() for an explanation.
Upvotes: 5
Reputation: 26467
$('#foo').removeAttr('disabled');
OR you can set attr to ""
$('#foo').attr('disabled', '');
Upvotes: 0
Reputation: 85056
This should do it:
$('#foo').removeAttr('disabled');
and this as well:
$('#foo').attr('disabled', '');
Upvotes: 3