I am new at Jquery and was hoping for some advice as to how to call a jQuery function using a check box.
$(document).on("click", "input[name='chkBestSeller']", function () {
alert("Thanks for checking me");
});
<input type='checkbox' name='chkBestSeller' value='Best Seller'/>
At the moment, it is not working.
Try this:
<input type='checkbox' id='isSelected'/>
$('#isSelected').bind('change', function () {
if ($(this).is(':checked'))
alert("Checked");
else
alert("Unchecked");
});
Try this:
$('input[name="chkBestSeller"]').click(function () {
alert("Thanks for checking me");
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With