Attempting to apply custom CSS to enhance the appearance of checkboxes using input
and label
elements. The goal is to make the font-weight bold
when a user clicks on the checkbox, and then revert it back to regular
if clicked again. Currently stuck on this styling challenge!
$(function() {
var action = 1;
$('.control--checkbox input').on("click", handleFontWeight);
function handleFontWeight() {
if (action == 1) {
adjustFontWeight("bold");
action = 2;
} else {
adjustFontWeight("400");
action = 1;
}
}
function adjustFontWeight(val) {
$('.control--checkbox').css({
fontWeight: val
})
}
});
.control-group {
display: inline-block;
vertical-align: top;
}
/* Rest of the CSS code remains unchanged */
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="facet-group">
<h3>Operating System</h3>
/* HTML structure for checkboxes remains intact */
</div>