JSFiddle - React, Tailwind, and code Playground

HTML

<div id="servemod">
   <ul>
       <li><input type="checkbox" checked><p>box 1</p></li>
       <li><input type="checkbox"><p>box 2</p></li>
   </ul>
</div>

CSS

.grey{
   background-color: red;
}

JavaScript

$('#servemod li').each(function(){
    if($(this).find(':checkbox').is(':checked')){
        $(this).addClass('grey');
    }
   
});