X
X
X
Website Search®
X
Blog Archive®

❖ Ubah Kondisi Elemen Induk Jika CheckBox Dicentang (Checked)

JQuery Snippets

JQuery

$('div.area').find('input:checkbox').change(function() {
if ($(this).is(':checked')) {
$(this).parent().addClass('active');
} else {
$(this).parent().removeClass('active');
}
});

CSS

.area {
padding:10px;
border:1px solid #ccc;
}

.active{background-color:yellow;}


Thank's Mottie :D
X

Posting Komentar