html代码:
<input id="rad1" name="rad" type="radio" value="1"/>
<input id="rad2" name="rad" type="radio" value="2"/>
<input id="rad3" name="rad" type="radio" value="3"/>
使用jquery可以很方便的获取到同一组的radio选中的value值
<script src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
function doit(){
alert($("input[name='rad']:checked").val());
}
</script> <input id="rad1" name="rad" type="radio" value="1"/>
<input id="rad2" name="rad" type="radio" value="2"/>
<input id="rad3" name="rad" type="radio" value="3"/>
<input type="button" onclick="doit()" value="click">
转自:http://blog.163.com/gis_warrior/blog/static/19361717320136301754294