I have some labels like:
<label>
<input type="checkbox" name="the_name" id="the_name" /> Label text
</label>
that sometimes are disabled
$("#the_name").prop('disabled', true);
No problem, but I would like to change label text color to make it more visible. Is it possible using Jquery and/or CSS?
you can add a css rule to the label by selecting the parent of your input and adding to that at the time you disable the control
Additionally, I think label is meant to be used like this:
where the label’s
forattribute matches theidof the target controlin which case you could select the label by it’s
forattribute and apply css as you see fit – something like this:See fiddle for demo: http://jsfiddle.net/bq52X/