change event
Live Demo →
API Documentation →
New features
- dispatch a
change
event on user action (#92)
Implementation is aligned with input[type="checkbox"]
as it is only fired when the user changes the value by interacting with the component.
const myCheckbox = document.getElementById('my-checkbox')
myCheckbox.addEventListener('change', () => {
console.log(myCheckbox.checked)
})