Pure javascript:
const checkbox = document.getElementById('myCheckbox')
checkbox.addEventListener('change', (event) => {
if (event.currentTarget.checked) {
alert('checked');
} else {
alert('not checked');
}
})
_x000D_
My Checkbox: <input id="myCheckbox" type="checkbox" />
_x000D_