const checkbox = document.getElementById('checkbox-id')
checkbox.addEventListener('change', (event) => {
if (event.currentTarget.checked) {
console.log('checked');
} else {
console.log('not checked');
}
})
Form would look like this:
<input id="checkbox-id" type="checkbox" />
Add new comment