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);

0 0 vote
Article Rating
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x