1.获取选中值,三种方法都可以:

$('input:radio:checked').val();

$("input[type='radio']:checked").val();

$("input[name='rd']:checked").val();

2.设置第一个Radio为选中值:

$('input:radio:first').attr('checked', 'checked');

或者

$('input:radio:first').attr('checked', 'true');

注:attr("checked",'checked')= attr("checked", 'true')= attr("checked", true)

3.设置最后一个Radio为选中值:

$('input:radio:last').attr('checked', 'checked');

或者

$('input:radio:last').attr('checked', 'true');

4.根据索引值设置任意一个radio为选中值:

$('input:radio').eq(索引值).attr('checked', 'true');索引值=0,1,2....

或者

$('input:radio').slice(1,2).attr('checked', 'true');

5.根据Value值设置Radio为选中值

$("input:radio[value='rd2']").attr('checked','true');

或者

$("input[value='rd2']").attr('checked','true');

6.删除Value值为rd2的Radio

$("input:radio[value='rd2']").remove();

7.删除第几个Radio

$("input:radio").eq(索引值).remove();索引值=0,1,2....

如删除第3个Radio:$("input:radio").eq(2).remove();

8.遍历Radio

$('input:radio').each(function(index,domEle){

//写入代码

});

最新文章

  1. LeetCode Moving Average from Data Stream
  2. linux基础-第十六单元 yum管理RPM包
  3. mybatis异常
  4. Vim tips
  5. [原 -> 砖] C# IEnumerable<T>泛型取值
  6. android 登陆案例_sd卡
  7. (转)smarty实现多级分类的方法
  8. CSS知识点:清除浮动
  9. 在ERP中定义用户时报错:SqlDateTime 溢出。必须介于 1/1/1753 12:00:00 AM 和 12/31/9999 11:59:59 PM 之间
  10. WINDOWS下运行ORACLE SQLPLUS时报错的一次记录
  11. PHP 点阵5*7字体
  12. [Swift]LeetCode363. 矩形区域不超过 K 的最大数值和 | Max Sum of Rectangle No Larger Than K
  13. jsonwebtoken收藏博客地址
  14. Swoole 心跳检测
  15. ngnix——FastCGI 相关参数调优
  16. 如何使用navicat远程连接服务器上的oracle数据库
  17. 容器内部设置JVM的Heap大小
  18. Spring JDBC调用存储函数
  19. 高斯混合模型Gaussian Mixture Model (GMM)
  20. Win32 API编程:使用CreateProcess创建新进程

热门文章

  1. 如何:为iOS 的方法写注释 让xcode 能够索引得到?
  2. 组织安全性SQL
  3. Getting OS version with NDK in C c++获得版本号
  4. java数字转换成文字方法
  5. 处理【Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operatio】
  6. Plupload设置自定义参数
  7. idea自动生成serialVersionUID , serialVersionUID的作用
  8. QT中文乱码与国际化支持
  9. webservice发布问题,部署iis后调用不成功
  10. 九度oj-1001-Java