JSFiddle - React, Tailwind, and code Playground

by Daniel Lamb

HTML

Toggle button: <input id="toggle" type="checkbox" />
<br/><button>Button</button>

JavaScript

$('#toggle').on('click', function(){
    // set the element disabled state based on the checkbox
    $('button').prop('disabled', this.checked);
});