title: Updating visual cue of checkbox state via code in jQuery
body: <p>I have the following HTML on my page:</p>
  
  <pre><code> &lt;input id="chkIncludeCA3" type="checkbox" /&gt;&lt;label for="chkIncludeCA3"&gt;Category 3:&lt;/label&gt;
  </code></pre>
  
  <p>And on my code page, the following piece of script:</p>
  
  <pre><code>$('#chkIncludeCA3').prop('checked', true);
  </code></pre>
  
  <p>Can someone explain to me how I would also update the visual state of the label to show that the checkbox is indeed checked?</p>
  
  <p><em>EDIT</em></p>
  
  <p>Thanks to Christophe Roussy for the correct pointer, have discovered the following works perfect:</p>
  
  <pre><code>$('#chkIncludeCA3').prop('checked', true); $("label[for='chkIncludeCA3']").addClass('ui-state-active');
  </code></pre>
  
  <p>If anyone knows if there is a more official way, I'd appreciate it.</p>