I'd like to amend my script so if ANY of the 2 checkboxes are selected, it says 'Woo hoo!'. Where am I going wrong?
HTML:
0:<input type="checkbox" name="remove_0" id="remove_0">
<br>
1:<input type="checkbox" name="remove_1" id="remove_1">
<br><br>
<button id="submitTCP">
Hit me!
</button>
Javascript:
$("#submitTCP").click(function(event){
event.preventDefault();
if ($('input:checkbox', this).is(':checked')) {
alert('Woo hoo!');
} else {
alert('Please select something!');
return false;
}
})
JSFiddle: