jquery获取radio值
单选组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="单选" id="radiogroup1_0">
单选</label>
<br>
<label>
<input type="radio" name="radiogroup1" value="单选" id="radiogroup1_1">
单选</label>
<br>
<label>
<input type="radio" name="radiogroup1" value="单选" id="radiogroup1_2">
单选</label>
<br>
<label>
<input type="radio" name="radiogroup1" value="单选" id="radiogroup1_3">
单选</label>
<br>
<label>
<input type="radio" name="radiogroup1" value="单选" id="radiogroup1_4">
单选</label>
<br>
<label>
<input type="radio" name="radiogroup1" value="单选" id="radiogroup1_5">
单选</label>
<br>
</p>
</form>
from:http://www.111cn.net/wy/jquery/jquery-radio.htm
jquery获取radio值的更多相关文章
- jquery获取radio和select选中值
//jquery 获取radio选中值 <input type="radio" name="c_type" value="a" > ...
- jQuery获取Radio选择的Value值||两个select之间option的互相添加操作(jquery实现)
jQuery获取Radio选择的Value值: 1. $("input[name='radio_name'][checked]").val(); //选择被选中Radio的Val ...
- 使用jquery获取radio的值
使用jquery获取radio的值,最重要的是掌握jquery选择器的使用,在一个表单中我们通常是要获取被选中的那个radio项的值,所以要加checked来筛选,比如有以下的一些radio项: ...
- jquery获取radio选中值及遍历
使用jquery获取radio的值,最重要的是掌握jquery选择器的使用,在一个表单中我们通常是要获取被选中的那个radio项的值,所以要加checked来筛选,比如有以下的一些radio项:1.& ...
- jQuery获取多种值的方法
**jQuery 1.3.2版本下的 jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关设置** 1.判断是否已经打 ...
- jquery获取kindEditor值
KE.show({ id: 'txtMessage', imageUploadJson: '/ajax/Manager/keupload.ashx?ptyp ...
- jQuery获取radio选中后的文字
原文链接:http://blog.csdn.net/zhanyouwen/article/details/51393216 jQuery获取radio选中后的文字转载 2016年05月13日 10:3 ...
- jquery 获取radio选中的值
如下案例:常用方法 1.获取选中值,三种方法都可以: $('input:radio:checked').val(): $("input[type='radio']:checked" ...
- Jquery 获取 radio选中值,select选中值
随着Jquery的作用越来越大,使用的朋友也越来越多.在Web中,由于CheckBox.Radiobutton .DropDownList等控件使用的频率比较高,就关系到这些控件在Jquery中的操作 ...
随机推荐
- Unity3d -> Xcode 多个渠道版本发布文件合并
第一步: Users/xxx/.jenkins/jobs/projectname/workspace/build/iOS_iphone 把这里面所有文件拷贝到生成的xcode 工程下的Data目录 如 ...
- 自定义控件之万能Repeater源码
using System.ComponentModel; using System.Web.UI; [assembly: TagPrefix("Jinlong.Control", ...
- javascript64位加密
var base64 = new Object(); base64.settings = { char: "+/", pad: "=", ascii: fals ...
- Mina.Net实现的UDP协议消息收发Demo
using Mina.Filter.Codec; using Mina.Filter.Codec.TextLine; using System; using System.Collections.Ge ...
- 定时执行任务FluentScheduler
private void Form1_Load(object sender, EventArgs e) { Registry registry = new Registry(); registry.S ...
- 压力测试 JMeter3.3
历史下载版本 https://archive.apache.org/dist/jmeter/source/
- javascript constrator and prototype
揭开js之constructor属性的神秘面纱 在js里面当new了一个对象时,这中间发生了什么? MDN - new运算符 当代码 new foo(...) 执行时: 一个新对象被创建.它继承自fo ...
- 查看MySQL的当前日期
select current_date(); 查看MySQL的当前日期
- 【转】Jenkins怎么启动和停止服务
笔者没有把Jenkins配置到tomcat中,每次都是用命令行来启动Jenkins.但是遇到一个问题:Jenkins一直是开着的,想关闭也关闭不了.百度了一些资料,均不靠谱(必须吐槽一下百度).于是进 ...
- 编译Boost库
VS版本: 虽然网络上有,但是还是记录下,找到VS的command prompt,然后切换到boost的根目录: 1.运行 bootstrap.bat 它在当前目录下会生成b2.exe2. 2.运行b ...