What is the most effective way of unchecking a checkbox?
I'm trying to determine the most efficient way to simulate a user un-checking a checkbox. When I try to clear form elements via JQuery, I'm jumping through hoops to manage all of the styling. It feels like I'm missing something fundamental.
For example, right now, I can do the following to simulate an un-check event but it feels pretty squirrely.
$('#checkbox-label').attr('checked',false);
$('label[for=checkbox-label]').removeClass('ui-btn-active');
$('label[for=checkbox-label]').find('span.ui-icon-checkbox-on').addClass('ui-icon-checkbox-off');
$('label[for=checkbox-label]').find('span.ui-icon-checkbox-on').removeClass('ui-icon-checkbox-on');
Thoughts?