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.
精彩评论