JSFiddle - React, Tailwind, and code Playground
HTML
<form action="">
<!-- this is like the echo in php IS DISABLED -->
<input type='submit' name='buy' value='Buy' disabled='disabled' id='buy'/>
<!-- End of echo in PHP -->
</form>
<script>
var buyButton = document.getElementById('buy');
buyButton.disabled = false; // IS ENABLED
</script>