Quick access to value. Provide a checkbox by string id or object reference. If a callback is supplied, it will be called when the checkbox changes value.
const opt = checkbox(`#chkMate`);opt.checked; // Gets/setsconst opt = checkbox(document.getElementById(`#chkMate`), newVal => { if (newVal) ...}); Copy
const opt = checkbox(`#chkMate`);opt.checked; // Gets/setsconst opt = checkbox(document.getElementById(`#chkMate`), newVal => { if (newVal) ...});
Optional
Quick access to value. Provide a checkbox by string id or object reference. If a callback is supplied, it will be called when the checkbox changes value.