disable all form elements inside div
For jquery 1.6+, use .prop()
instead of .attr()
,
$("#parent-selector :input").prop("disabled", true);
or
$("#parent-selector :input").attr("disabled", "disabled");
Simply this line of code will disable all input elements
$('#yourdiv *').prop('disabled', true);
Try using the :input
selector, along with a parent selector:
$("#parent-selector :input").attr("disabled", true);
$('#mydiv').find('input, textarea, button, select').attr('disabled','disabled');