Hey,
It is working fine.
I don't know the control you have taken for
"toGroup"
.
But I have taken that as a button and tested, the code is working.
Case-1
When checkbox is checked, the below line will calculate as
true.
var check = val.checked;
So, the button will be
enabled as per the code below.
document.getElementById("toGroup").disabled = !check;
Case-2
When checkbox is un-checked, the below line will calculate as
false.
var check = val.checked;
So, the button will be
disabled as per the code below.
document.getElementById("toGroup").disabled = !check;
Check the
Live Demo[
^].
Thanks...