【发布时间】:2011-09-25 20:43:32
【问题描述】:
我想检查选择的无线电输入是什么。
这是我的代码。
<input name="u_type" type="radio" value="staff" id="u_type" checked="checked" /> Staff
<input name="u_type" type="radio" value="admin" id="u_type" /> Admin
<input id="add_user" name="add_user" type="button" onclick="addUser();" value="Add" class="submitButton admin_add" />
function addUser()
{
//how to check what is the selected radio input
}
谢谢。
【问题讨论】:
-
您是否有机会使用 jQuery 或可以在您的代码中使用?
-
如果你只有两个按钮,这会帮助你:stackoverflow.com/questions/1423777/…
标签: javascript radio selected