JSFiddle - React, Tailwind, and code Playground
HTML
<div id="bat">батон</div>
<input id="che" type="checkbox" />
CSS
#bat {
width:100px;
height:30px;
background-color:#0FF;
text-align:center;
padding-top:8px;
margin:20px;
cursor:pointer;
}
#che {
margin:20px;
}
JavaScript
$("#bat").click(function(){
if (!$("#che").prop("checked")) {
$('#che').attr('checked', 'checked');
}
else {
$('#che').removeAttr('checked');
}
});