I have the below HTML code
<div class="form-checkboxes">
<div class="js-form-item">
<input data-drupal-selector="edit-field-faqs-categories-target-id-24" type="checkbox" id="edit-field-faqs-categories-target-id-24--sdfdf" name="field_faqs_categories_target_id[24]" value="24" checked="checked" class="form-checkbox">
<label for="edit-field-faqs-categories-target-id-24--sdfdf" class="option">APIs</label>
</div>
<div class="js-form-item">
<input data-drupal-selector="edit-field-faqs-categories-target-id-21" type="checkbox" id="edit-field-faqs-categories-target-id-21--wwww" name="field_faqs_categories_target_id[21]" value="21" checked="checked" class="form-checkbox">
<label for="edit-field-faqs-categories-target-id-21--wwww" class="option">Business</label>
</div>
</div>
I have input checkboxes with a parent div js-form-item
. If the checkbox is checked I want to add a background color to the parent div
I tried the below code, but its not working
.js-form-item:has(> input[type=checkbox]:checked){
background:#000000
}
Can anyone please help