jquery获取单选button选中的值

it2025-09-30  62

 在页面上单选button的代码:

<s:iterator value="@com.hljw.cmeav.util.CmeavGlobal@isComMap"> <input type="radio" <s:if test="key eq record.is_com">checked</s:if> value="${key}" name="record.is_com"/>${value}    </s:iterator> 获取单选button选中的值,并给指定的单选button赋值:

if($('input[name="record.is_com"]:checked').val() == 0){ $("input[name=record.is_com][value=1]").attr("checked",true); } 以上的功能就是推断:假设当前选中的单选button的值为0,就将单选button的值为1的button选中。

转载于:https://www.cnblogs.com/bhlsheji/p/3835516.html

最新回复(0)