获取单选按钮的值

<form id="emailTop"name="emailTop"><input type="hidden"name="id" />

<h3 class="c_violet">   <span class="butBuy r"> <a href="javascript:;"

class="butBuy-auto3" onclick="fUpdate()">设为默认a>   <a

href="javascript:;" class="butBuy-auto5" onclick="fDelete();">删除地址a>span>h3>form>

<th><c:iftest="${list.tag == 1}"><inputtype="radio"value="${list.id}"name="aa"    checked="checked"/>th>c:if>

<c:if test="${list.tag == 0}"><input type="radio" value="${list.id}"name="aa" />th>c:if>

Jquery的使用:

//修改

    function fUpdate() {

        document.emailTop.id.value =$("input[name='aa']:checked").val();

        document.emailTop.action = "${pageContext.request.contextPath}/client/updateTbRevAddr.do";

        document.emailTop.submit();

    }//删除

    function fDelete() {

        document.emailTop.id.value =$("input[name='aa']:checked").val();

        document.emailTop.action = "${pageContext.request.contextPath}/client/deleteTbRevAddr.do";

        document.emailTop.submit();}

你可能感兴趣的:(获取单选按钮的值)