Javascript : Checkbox
Vanilla
//ternary
var isChecked = t.checked ? 1 : 0;
if (this.checked) {
} else {
}
jQuery
if (cb.is(':checked')) {
} else {
}
//make it checked
cb.prop("checked", true);
//ternary
var isChecked = t.checked ? 1 : 0;
if (this.checked) {
} else {
}
if (cb.is(':checked')) {
} else {
}
//make it checked
cb.prop("checked", true);