zoukankan      html  css  js  c++  java
  • jquery获取单选button选中的值

     在页面上单选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选中。

  • 相关阅读:
    知识加油站
    markdown 使用
    今日计划
    继续继续
    我回来了
    2020/5/8
    2020/5/10
    明天一定要学习了
    入驻博客园
    this is a test
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/3835516.html
Copyright © 2011-2022 走看看