title: Trigger a programmatically 'checked' checkbox with jQuery
body: <p>I want to trigger a programmatically <em>checked</em> checkbox. eg:</p>
  
  <pre><code>$(function(){
      //create a trigger that if a checkbox changes, eg is clicked/change show an alert
      $("#idCheckbox").on("change", function(){
          if($(this).is(':checked')){
              alert("Is checked!");
          }
      });
  
      //onload put it checked
      $("#idCheckbox").attr("checked", "checked");
  });
  </code></pre>
  
  <p>The 'problem' is that if I check on load the checkbox by javascript the on() method is not triggered, and the alert is not shown.</p>
  
  <p>The code above is an example, in fact <strong>the script which check the checkbox is not mine</strong> and I can't modify it.</p>
  
  <p>I am using jQuery 1.8.0</p>
  
  <p>Any suggestion?</p>
  
  <p>Thanks in advance.</p>