Is there a way to show or hide a div based on a checkbox click? I've got it working in jsFiddle, but for some reason, it's not functioning properly on my website. Any thoughts on how to fix this?
My goal is to offer multiple payment methods (credit card, Paypal, etc.) and display the relevant payment information based on the method selected. Here's the link to the jsFiddle example:
This is the JavaScript code I'm using:
$('#CCMethod').change(function(){
if (this.checked) {
$('#CCPay').fadeIn('slow');
} else {
$('#CCPay').fadeOut('slow');
}
});
You can check out the staging area of my site here: