I can't get this onClick event to control the checked status of the checkbox.. any thoughts?
init: function () {
$('.billing input[type="checkbox"]').bind('click', function (e) {
e.preventDefault();
iKeyless.page.toggleShippingForm($(e.currentTarget));
});
},
toggleShippingForm: function (el) {
if (el.attr('checked')) {
$('.shipping').parents('.yui-u').addClass('hide');
el.attr('checked', false);
} else {
$('.shipping').parents('.yui-u').removeClass('hide');
el.attr('checked', true);
}
}
It loads with the checkbox checked and it stays checked regardless of what I do...
See Question&Answers more detail:os