开发者

jQuery error when reading radio button values in Firefox but not in Safari

I get the following error in Firefox/Firebug but not in Safari.

$("input[name='how_many']:checked").val is not a function

Code follows:

$(document).ready(function(){
    $("#message-form").change(function(){

        var selectedRadio = $("input[name='how_many']:checked开发者_JAVA技巧").val();

        if(selectedRadio == "some")
        {
              $("#conditional").fadeIn("slow");
        }else{
              $("#conditional").fadeOut("slow");
        };        
    });
});


Not sure why this fixed it but I moved my scripts to the bottom in front of and now it's working in Firefox, Chrome and Safari.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜