JSFiddle - React, Tailwind, and code Playground
by Town
HTML
<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/>
CSS
.selected { padding: 2px; background-color: blue; }
JavaScript
$('input[type=checkbox]').click(function() {
$(this).unwrap().filter(":checked").wrap("<span class='selected'>");
});