ITeye博客

JQuery获取Radio选中的值

xdwangiflytek · 2012-08-31 14:57 · Js/Jquery · Web前端 · Markdown

JS:
var type = $("input:[name=uploadType]:radio:checked").val();

HTML:
<input type="radio" name="uploadType" value="doc" id="tt1"/>
<label for="tt1">Document</label>&nbsp;&nbsp;
<input type="radio" name="uploadType" checked="checked" id="tt2" value="audio" />
<label for="tt2">Media</label>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。