JSFiddle - React, Tailwind, and code Playground
by some
HTML
<div id="not-clicker">
<div id="clicker" onClick="clickBox();">
</div>
</div>
CSS
#clicker {
height: 50px;
width: 50px;
background-color: red;
cursor: pointer;
}
#not-clicker {
height: 100px;
width: 100px;
background-color: pink;
}
#not-clicker:active {
opacity: .5;
}
JavaScript
function clickBox() {
document.getElementById('clicker').style.backgroundColor='green';
};