JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" id="myButton" value="Click!"/>
<input type="button" id="check" value="check here" />

JavaScript

$(function(){
    
    $('#check').click(function(){
        if( $('#myButton').prop('disabled') ) { 
            alert('disabled'); 
            $('#myButton').prop('disabled',false);
        } 
        else {
            alert('enabled');
            $('#myButton').prop('disabled',true);
        }
    });
});