在Firefox中读取单选按钮值时出现jQuery错误,但在Safari中没有



我在Firefox/Firebug中得到以下错误,但在Safari中没有。

$("输入[name = '还有']:检查")。Val不是函数

代码:

$(document).ready(function(){
    $("#message-form").change(function(){
        var selectedRadio = $("input[name='how_many']:checked").val();
        if(selectedRadio == "some")
        {
              $("#conditional").fadeIn("slow");
        }else{
              $("#conditional").fadeOut("slow");
        };        
    });
});

不知道为什么这个固定,但我把我的脚本移到前面的底部,现在它在Firefox, Chrome和Safari中工作

相关内容

最新更新