JSFiddle - React, Tailwind, and code Playground
by core972
HTML
<input type="checkbox" id="scales" name="scales" checked />
<label for="scales">Scale</label>
<form action="#">
<input type="radio" name="nom" id="nom_a"><label for="nom_a">nom_a</label>
<input type="radio" name="nom" id="nom_b"><label for="nom_b">nom_b</label>
<input type="radio" name="nom" id="nom_c"><label for="nom_c">nom_c</label>
</form>
<form action="#">
<input type="radio" name="nom" id="nom_d"><label for="nom_d">nom_d</label>
<input type="radio" name="nom" id="nom_e"><label for="nom_e">nom_e</label>
<input type="radio" name="nom" id="nom_f"><label for="nom_f">nom_f</label>
</form>
JavaScript
const sca = document.getElementById("scales");
setInterval(() => {
let status = ( sca.checked === true); //console.log(status, sca.checked);
if (status) {
sca.checked = false;console.log(5, status, sca.checked);
} else {
sca.checked = true;console.log(7, status, sca.checked);
}
// sca.setAttribute("checked", !status)
}, 1000)