I am trying to find the easiest way to get the checkboxes that are selected.
Here's my script:
$(document).ready(function() {
$("input[name='chkTextEffects']").change(function() {
if ($("#cbSolid").is(':checked') == true) {
alert('Solid');
} else if ($("#cbOutline").is(':checked') == true) {
alert('Outline');
} else if ($("#cbSolid", "#cbOutline").is(':checked') == true) {
alert('SolidOutline');
} else if ($("#cbSolid", "#cbOutline").is(':checked') == false) {
alert('No Effects');
}
});
});
HTML:
<input type="checkbox" name="chkTextEffects" id="cbSolid" value="Solid" />Solid
<input type="checkbox" name="chkTextEffects" id="cbOutline" value="Outline" />Outline
<input id="TextEffectsSelection" type="hidden" />
I'm not sure about this line if ($("#cbSolid", "#cbOutline").is(':checked') == true) or should I use bind to get that worked.