The
disabled
attribute does not exist on a table row. You have to apply it on its inner
input
elements. Also, the
jQuery documentation[
^] recommends to use
.prop()
instead of
.attr()
for DOM properties such as
disabled
.
So, to disable/enable all input elements in a row, try this:
$("tr.statuscheck input, tr.statuscheck select, tr.statuscheck textarea").prop('disabled', true);
$("tr.statuscheck input, tr.statuscheck select, tr.statuscheck textarea").prop('disabled', false);
The above code lines disable/enable all
input
,
select
and
textarea
elements inside a
tr
tag with class
statuscheck
.