Here is the way for plain JS, which onchange
and onclick
events are combined (onchange
for checking while onclick
for unchecking).
document.querySelector("input").onchange = function() {
this.onclick = function() {
this.checked = false;
this.onclick = null;
}
};