Is there a way to apply the cursor:pointer
style to checkboxes and their labels, but only for those that are not disabled?
This is the code snippet I am currently using:
<label>
<input
type="checkbox"
...more attributes...
> Yes, please specify:
</label>
In my CSS, I have the following rule:
input[type=checkbox]:not([disabled]),
label + input[type=checkbox]:not([disabled]) {
cursor: pointer;
}
To disable a checkbox, I use jQuery like this:
$("selector").prop("disabled", true);
$("selector").prop("disabled", false);
I'm facing an issue with targeting the <label>
element that contains a disabled checkbox. Any suggestions on how to accomplish this?
Thank you for your input.
You can test a code example provided by someone here: http://codepen.io/8odoros/pen/BQVQGg