JSFiddle - React, Tailwind, and code Playground
by alpacalips
HTML
<li class="activate_post_checkbox">
<input type="checkbox" id="activate_post_checkbox" value="active" /><span id="activate_post_checkbox_text">Make my posting active immediately.</span>
</li>
JavaScript
$(function() {
$('#activate_post_checkbox_text').css('color', '#666666');
$('#activate_post_checkbox').change(function(){
if($(this).is(':checked')) {
$('#activate_post_checkbox_text').css('color', 'black');
} else {
$('#activate_post_checkbox_text').css('color', '#666666');
}
});
});