JSFiddle - React, Tailwind, and code Playground
HTML
<div id="radiocb" onclick="cbclick(event)">
<input type="checkbox" id="cb1"/> c1<br />
<input type="checkbox" id="cb2"/> c2<br />
<input type="checkbox" id="cb3"/> c3<br />
<input type="checkbox" id="cb4"/> c4<br />
</div>
JavaScript
function cbclick(e){
e = e || event;
var cb = e.srcElement || e.target;
if (cb.type !== 'checkbox') {return true;}
var cbxs = document.getElementById('radiocb').getElementsByTagName('input'), i=cbxs.length;
while(i--) {
if (cbxs[i].type && cbxs[i].type == 'checkbox' && cbxs[i].id !== cb.id) {
cbxs[i].checked = false;
}
}
// if the click should always result in a checked checkbox
// unconmment this:
// cb.checked = true;
}