I'm facing some problems with some jQuery or HTML.
I have some checkboxes. And I want to have a "primary" checkbox so a few checkboxes under that category get checked when the "primary" gets checked.
Well, that's OK. I solved it like this:
$('#extraPolish').change(function() {
if ($("#extraPolish").is(':checked') == true) {
$("#extraPolish_Inside").attr('checked', 'checked');
$("#extraPolish_UnderFender").attr('checked', 'checked');
$("#extraPolish_OverFender").attr('checked', 'checked');
console.log('checkd');
} else {
$("#extraPolish_Inside").removeAttr('checked');
$("#extraPolish_UnderFender").removeAttr('checked');
$("#extraPolish_OverFender").removeAttr('checked');
}
});
So when you check #extraPolish those under there get checked, and when you remove check on #extraPolish those will be unchecked.
The problem is when i try to check them again it shows in the HTML code, but won't get checked on my Google Chrome.
Any Idea?