JSFiddle - React, Tailwind, and code Playground
by Nick Craver
HTML
<div id="scrollwrap">
<div>
<input value="1" type="checkbox" name="salgsvilkar" id="checkbox2" style="float:left;" checked />
<label for="checkbox2" class="akslabel">Salgs og leveringsvilkår er lest og akseptert</label>
</div>
</div>
CSS
#scrollwrap
{
border: 1px solid #000;
padding: 20px;
width: 300px;
}
#scrollwrap.highlight
{
border: 1px solid #f00;
background-color: #0f0;
padding: 20px;
width: 300px;
}
JavaScript
$(function() {
$("#checkbox2").change(function(){
$("#scrollwrap").toggleClass('highlight', this.checked);
}).change();
});