title: Trigger onclick event with Javascript
body: <p>I am trying to trigger an <code>onclick</code> event via <strong><em>Chrome Developer Tools</em></strong> that will check all checkboxes on the page and also trigger the <code>onclick</code> event of all checkboxes on the page.</p>
  
  <p>Here is a sample checkbox on the page:</p>
  
  <pre><code>&lt;input type="checkbox" onclick="ctl00_ContentAreaHolder1_uctlLocationSelectionControl_AccountStructureTreeView.HandleCheck(this,'p_686660',4);" name="checker_p_686660"&gt;
  </code></pre>
  
  <p>Here is my code to check all checkboxes on the page:</p>
  
  <pre><code>(function() {
      var aa= document.getElementsByTagName("input");
      for (var i =0; i &lt; aa.length; i++){
          if (aa[i].type == 'checkbox')
              aa[i].checked = true;
      }
  })()
  </code></pre>
  
  <p>The only thing I cannot figure out is how to trigger the <code>onclick</code> event when the checkbox is checked. Any help is appreciated!</p>