xxxxxxxxxx
//for a class
$('.inputDisabled').prop("disabled", false);
//for an ID
$('#inputDisabled').prop("disabled", false);
xxxxxxxxxx
$('#edit').click(function(){ // click to
$('.inputDisabled').attr('disabled',false); // removing disabled in this class
});
xxxxxxxxxx
$('.class').prop("disabled", true);
$('#id').prop("disabled", true);
// As function
const disable = (id) => $(`#${id}`).prop("disabled", true);
xxxxxxxxxx
// Add disabled attribute to an element using jQuery
$(element).prop('disabled', true);
xxxxxxxxxx
<a href="#" id="button" role="button"> Click me </a>
<script>
$("#button").attr("disabled", true); // disabled = true
// $("#button").attr("disabled", false); // disabled = false
// attr cannot pls switch to prop
$('#button').prop("disabled", true);
</script>
xxxxxxxxxx
$("#edit").click(function(event){
event.preventDefault();
$('.inputDisabled').prop("disabled", false); // Element(s) are now enabled.
});
xxxxxxxxxx
// Add disabled attribute to an element with id "myElement"
$('#myElement').prop('disabled', true);