Reputation: 19772
I want to be able to select all disabled decandants of a given element, in my particular instance a table cell and then enable them.
NOTE that there may be elements that are not "inputs"
I have tired the following with no success
$("#myCell [disabled='disabled']").removeAttr('disabled')
and
$("#myCell [disabled='disabled']").attr('disabled','')
Upvotes: 0
Views: 156
Reputation: 2336
My solution:
$("#myCell *[disabled='disabled']").removeAttr("disabled");
This * selector means 'all elements'
Upvotes: 0
Reputation: 488394
Try:
$('#myCell :input:disabled').removeAttr('disabled');
The :input
selector is going to select all input elements, and the :disabled
selector is going to select elements that are disabled. You could probably just have the :disabled
selector but it doesn't hurt to have both and is probably marginally faster to do so.
Upvotes: 3