input 单选按钮radio 取消选中
//需要先引入JQ.js
<input name="rdo" value="AA" type="radio" tag="0" />A
<br />
<input name="rdo" value="BB" type="radio" tag="0" />B
<br />
<input name="rdo" value="CC" type="radio" tag="0" />C
<script>
$(":radio").click(function () {
var r = $(this).attr("name");
$(":radio[name=" + r + "]:not(:checked)").attr("tag", 0);
if ($(this).attr("tag") == 1) {
$(this).siblings().attr("checked", false);
$(this).attr("checked", false);
$(this).attr("tag", 0);
$(this).siblings().attr("tag", 0);
}
else {
$(this).attr("tag",1);
$(this).siblings().attr("checked", false);
$(this).siblings().attr("tag", 0);
}
});
</script>
input 单选按钮radio 取消选中的更多相关文章
- input 单选按钮radio 取消选中(转载)
input单选按钮: 在radio按钮中添加属性tag 0代表未被选中 HTML代码: <input name="rdo1" value="AA" ty ...
- jquery判断单选按钮radio是否选中的方法
JQuery控制radio选中和不选中方法总结 一.设置选中方法 复制代码代码如下: $("input[name='名字']").get(0).checked=true; $(&q ...
- Ext Radio 取消选中
今天,做项目的时候遇到了要吧Ext Radio单选按钮取消选中状态,由于没有在formpanel中写, 导致不能用reset()方法,试了各种方法,最后这样写管用. radio1.setValue(f ...
- IE6/7 单选按钮 radio 无法选中解决方法
原文地址:http://blog.sina.com.cn/s/blog_74d6cedd0100ugih.html 今天在做一个页面,居然ff没问题,ie6/7上浏览的时候radio单选按钮不能被选中 ...
- 获取<input type="radio">被选中的内容
背景: <input type="radio">,该标签表示的是单选按钮,这个类型相对于其他类型的获取,比较特殊,特此记录一下. 获取方式: 1. 使用选择器直接获取( ...
- 点击文字,把input type="radio"也选中
本文原文地址:https://my.oschina.net/jack088/blog/469815 1. <label> <input type="radio" ...
- 如何判断单选按钮radio被选中
今天要写一个单选按钮选中之后显示某些内容,首要问题就是当选中如何获取到值! html代码如下 <input class="joined" type="radio&q ...
- 微信小程序单选按钮radio选中的值value的获取方法,setTimeout定时器的用法
获取radio值的方法: func:function(e){ var val=e.detail.value;//获取radio值,类型:字符串 var val2=parseInt(val);//将字符 ...
- 单选按钮(radio)的取值和点击事件
笔记走一波:获取单选按钮(radio)的选中值,以及它的点击事件的实现 首先要引入Jquery <script type="text/javascript" src=&quo ...
随机推荐
- mysql--笔记1
今日内容介绍1.MySQL数据库2.SQL语句=========================================================1 数据库概念 1.1: 什么是数据库 ...
- 解决java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext问题
使用ClassPathXmlApplicationContext加载项目时, ClassPathXmlApplicationContext context = new ClassPathXmlAppl ...
- Fiddler系统监控参数解读
转自:https://blog.csdn.net/txj236/article/details/38872855 在对系统监控的过程中,发现ClientConnected和ClientBeginReq ...
- redis系列:哨兵
1 简介 Sentinel(哨兵)是Redis 的高可用性解决方案:通过哨兵可以创建一个当主服务器出现故障时自动将从服务器升级为主服务器的一个分布式系统.解决了主从复制出现故障时需要人为干预的问题. ...
- dojo1.7 加载器
原文地址:http://dojotoolkit.org/documentation/tutorials/1.7/modules/ dojo现在支持在异步模块异步(AMD)定义中加入模块写入功能了,这使 ...
- linux源码安装apache
apache安装之前,需要安装APR.APR-Util和PCRE依赖包 下载 Apache 下载地址: http://httpd.apache.org/download.cgi (打开找最 ...
- C# 写 LeetCode easy #14 Longest Common Prefix
14.Longest Common Prefix Write a function to find the longest common prefix string amongst an array ...
- 本地机器和windows2003远程桌面之间复制粘贴文件
打开远程桌面连接-->选项-->本地资源-->磁盘驱动器 前面打勾然后再连接就可以了.
- Wet Shark and Bishops(思维)
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are nu ...
- nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx//conf/nginx.conf:117
SSL相关的配置加到了nginx的配置文件中后,nginx竟然启动不起来了 于是用如下命令测试问题所在: /usr/local/nginx/sbin/nginx -c /usr/local/nginx ...