我有两个这样的radiobuttons:
@Html.RadioButtonFor(model => model.Type, 0, new { @id = "rdnTypeUser",name="UserType"})
Primary
@Html.RadioButtonFor(model => model.Type, 1, new { @id = "rdnTypeUser",name="UserType"})
Secondary
我想在script.i中选择radiobutton的值,尝试下面的代码
var radSelected = $('input:radio[name=UserType]:checked').val();
但我得到的价值是undefined。我也在谷歌搜索过,但无法获得解决方案..