How to Disable or Enable button using jQuery
To disable or enable a button, we simply use the .attr()
method to set the disabled
attribute value. The button is enabled if we set false
; otherwise, set true
if we want the button to be disabled.
1. Enable the button
$('#submit-button').attr('disabled', false);
2. Disable the button
$('#submit-button').attr('disabled', true);