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中的操作 ...
随机推荐
- ubuntu 上使用valgrind
Valgrind是一个GPL的软件,用于Linux(For x86, amd64 and ppc32)程序的内存调试和代码剖析.你可以在它的环境中运行你的程序来监视内存的使用情况,比如C 语言中的ma ...
- 微信小程序 - scroll-into-view(提示)
scroll-view的参数scroll-into-view适用于索引以及回到顶部 .详情见官方文档scroll-view: 点击下载:scroll-into-view示例
- JERSEY中文翻译(第三章、模块和依赖)
Chapter 2 Modules and Dependencencies 2.1 Java SE 兼容 所有的Jersey组建都是基于Java6开发的,所以你的Java必须是Java6以上的版本才能 ...
- Gradle基本使用(1):安装、IDEA使用
安装配置Gradle Gradle 二进制版下载地址: https://gradle.org/install/ 下载后解压,并将 GRADLE_HOME/bin 添加到系统 path变量,即可: ...
- WorkFlow业务介绍
WorkFlow简介 WorkFlow在我们的系统中,解释为系统提示更为恰当一下,当一件事情发生的时候可能需要通知某些人,这样其他人就可以做后续的处理了. 两个SST dts_workflow - W ...
- hadoop 文件合并
来自:http://blog.csdn.net/dandingyy/article/details/7490046 众所周知,Hadoop对处理单个大文件比处理多个小文件更有效率,另外单个文件也非常占 ...
- 《React-Native系列》44、基于多个TextInput的键盘遮挡处理方案优化
曾经写过两篇关于在ReactNative上处理键盘遮挡输入表单TextInput的情况.建议读者能够先看看 1.<React-Native系列>33. 键盘遮挡问题处理 2.<Rea ...
- Flash XSS 漏洞详解 根治的好办法
本文的目的是深层次的分析Flash的ExternalInterface的XSS漏洞,并提出比较有效的解决方案. 首先,我们看看什么情况下,会出现XSS. 第一种情况: 把flas ...
- SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释(转)
原文:https://blog.csdn.net/yijiemamin/article/details/51156189# 这几天一直在整合SSM框架,虽然网上有很多已经整合好的,但是对于里面的配置文 ...
- RHEL7 在不同的环境中使用不同的网络配置文件
比如,我们可以设置RHEL7 系统在公司时使用一个网卡配置文件:在家时则使用另外一个配置文件(可以根据不同的环境设置多个网卡配置文件). 网卡配置信息如下: [root@rhel7 ~]# nmcli ...