0

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

$("input[name='how_many']:checked").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");
        };        
    });
});
4

1 回答 1

0

不知道为什么这会修复它,但我将我的脚本移动到前面的底部,现在它可以在 Firefox、Chrome 和 Safari 中运行。

于 2011-04-06T02:58:17.707 回答