JSFiddle - React, Tailwind, and code Playground
HTML
XXX:<input id="xxx" value="5"><br>
<button id="action">action</button>
<div id="box" class="no"></div>
CSS
#box {background-color: red; height: 100px; weight: 100px;}
.no {opacity: 0;}
.yes {opacity: 1;}
JavaScript
let xxx = document.getElementById('xxx');
let action = document.getElementById('action');
action.onclick = function() {xxx.value = parseInt(xxx.value) - 1;}
const box = document.querySelector('#box');
xxx.addEventListener('input', function() {
box.className = xxx.value === '0' ? 'yes' : 'no';
});