JSFiddle - React, Tailwind, and code Playground
HTML
<div class="click">Click me to Disable/Enable a html button</div>
<div class="showup">
<input id="Button" type="button" value=" + " style="background-color:grey"/>
</div>
CSS
.showup {
width: 100px;
height: 100px;
}
.click {
cursor: pointer;
padding-bottom: 10px;
}
JavaScript
$(document).ready(function() {
var button = $('#Button');
$(button).attr('disabled', 'disabled');
$('.click').click(function() {
if ($(button).attr('disabled')) $(button).removeAttr('disabled');
else $(button).attr('disabled', 'disabled');
});
$(button).click(function() {
alert('Enabled!');
});
});