I'm having a small issue. I am generating a checkbox list where the checkboxes are checked if the JSON value inside them is true and unchecked if the JSON value is false. So, if the checkbox is checked, the corresponding line of HTML looks like this:
<input id="to_be_shown_individually" type="checkbox" ${(this.to_be_shown_individually && 'checked')} value=> <br>
Now, I have provided the option for the user to check and uncheck the checkbox. However, when they uncheck the checkbox, its value always remains true. You can see in the first image that the checkboxes are checked, so I get true. But in the second attempt, even when I uncheck them, I still get true.
So, when I use
document.getElementById("to_be_shown_individually").value;
It always returns true, whether the user has unchecked the checkbox or not.