toggle checkbox css js code example Example: toggle checkbox in JavaScript checkbox.checked = !checkbox.checked;