JSFiddle - React, Tailwind, and code Playground

by matthieubrunet

HTML

<input type="checkbox" id="check" value="1">
    <label for="check">check</label>

JavaScript

$("input").change(function() {
    if (this.checked) {
        $(this).next().css("color","green");
    } else {
        $(this).next().css("color","black");
    }
});