Web APIs
change event
Reports committed changes to a control; commit timing varies by control type.
Formal Syntax & Structure
javascript syntaxjavascript
control.addEventListener("change", callback)Working Example
Example Snippetjavascript
const i=document.createElement("input");i.type="checkbox";i.setAttribute("aria-label","Enable option");document.body.append(i);i.addEventListener("change",()=>console.log(i.checked));i.click();i.click();