更新时间:2023-10-06 21:10:22
It's because your script
$('#CCMethod').change(function(){
if ($(this).is(':checked')) {
$('#CCPay').fadeIn('slow');
} else {
$('#CCPay').fadeOut('slow');
}
});
is running before #CCMethod
is declared. Wrap it in a doc-ready:
$(function() {
('#CCMethod').change(function(){
if ($(this).is(':checked')) {
$('#CCPay').fadeIn('slow');
} else {
$('#CCPay').fadeOut('slow');
}
});
});