JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" id="idbox" name="cboxwithlabel" value="Another check box">
<label for="idbox">
  <span class="listing" id="Test33">
    Another checkbox  </span>
</label>

CSS

span.listing {
    display: block;
  }

JavaScript

function changecolor( cbox, divId, firstcolor, secondcolor )
  {
    document.getElementById( divId ).style.background = cbox.checked ? firstcolor : secondcolor;
  }