Don't confuse client side and server side.
A checkbox in a HTML form (without any event handlers) passes it's value attribute to the receiving script when it is checked at the time of submission. You can click it on or off as often as you like. No variable is "set".
Checkboxes operate as toggles - when the toggle is on the value attribute is passed. When the toggle is off nothing, not even the checkbox name, is present.
Client side you can do all kinds of things using scripting - hwoever, it might be unreliable. I'd rather rely on the basic HTML form elements and the way they work.