title: Trigger an event when a checkbox is changed programmatically via JavaScript
body: <p>I need to know when a checkbox has been changed by Javascript using pure javascript.</p>
  
  <p>I have setup an 'onchange' event that successfully executes when the user changes the checkbox but this doesn't work when another JS function changes it using code like the following:</p>
  
  <pre><code>document.getElementById('mycheckbox').checked = true;
  </code></pre>
  
  <p>Is it possible to fire an event using pure JavaScript when JS either checks or unchecks a checkbox?</p>