单选组radio: $("input[@type=radio][@checked]").val();

单选组 radio: $("input[@type=radio]").attr("checked",'2');//设置value=2的项目为当前选中项

获取一组radio被选中项的值
var item = $('input[@name=items][@checked]').val();

radio单选组的第二个元素为当前选中值
$('input[@name=items]').get(1).checked = true

单选组 radio: $("input[@type=radio]").attr("checked",'2');//设置value=2的项目为当前选中项


jquery老的版本
var_name = $("input[@name='radio_name']:checked").val();
jquery 1.3以后的版本
var_name = $("input[name='radio_name']:checked").val();


看个获取radio值的jquery实例

function getra(){

var_name = $("input[name='isspecialcnt']:checked").val();
//alert(var_name);
if(var_name=='1'){
$("#isspecialcntyes").show();
$("#isspecialcntno").hide();
}
if(var_name=='0'){
$("#isspecialcntyes").hide();
(www.111cn.net) $("#isspecialcntno").show();
}
}

<form name="form1" method="post" action="">
<p>
<label>
<input type="radio" name="radiogroup1" value="单选" >http://www.111cn.net/wy/jquery/jquery-radio.htm

相关文章:

  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-09-11
猜你喜欢
  • 2021-12-07
  • 2022-12-23
  • 2021-11-10
  • 2021-06-20
  • 2022-12-23
相关资源
相似解决方案