A label appears after the checkbox, your code seems to be for the shortcut that wraps the checkbox, for example:
<label for="1" class="highlight">Orange <input type="checkbox" name="1" id="option one" value="orange"> </label>
Modify html or change JS to target the next element, not the nearest parent:
$( '.checkboxes' ).on( 'click', 'input[type="checkbox"]', function () { $( this ).next('label').toggleClass( 'highlight', this.checked ); });
Also, your CSS is wrong, and targeting the label will directly depend on the selection class, so it will never change color, even if the class is applied.
Here is the fiddle, I fixed it, being more specific when I targeted the highligth class:
Fiddle
And Ramson is right, you have to check the box with brackets and type = "".
source share