可能重复:
Click Toggle with jQuery
我试了一个小时来切换一个复选框。尝试了一切,但我不能让这个工作。
$('#edit-customer-profile-shipping .fieldset-title').click(function() {
if ($('#edit-customer-profile-shipping input.toggler').is(':checked')) {
$('#edit-customer-profile-shipping input.toggler').attr('checked', false);
} else {
$('#edit-customer-profile-shipping input.toggler').attr('checked', true);
};
});
有人可以帮帮我吗?