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