jquery判断radioButton是否被选中
so easy
HTML:
<input type='radio' style='width:20px' id='other' name='projectType' value='其他' />其他(具体类别<input style='width:200px' type='text' name='exactKind' value='$!{form.exactKind}' />)
JQuery:
if($('#other').attr('checked')) {
alert();
}
值得注意的是,如果==true是不识别的,(用火狐35.0,其他没试)
要写成=='checked'
if($('#other').attr('checked', true)) //这样写先把other设为选中
jquery判断radioButton是否被选中的更多相关文章
- jquery判断单选按钮radio是否选中的方法
JQuery控制radio选中和不选中方法总结 一.设置选中方法 复制代码代码如下: $("input[name='名字']").get(0).checked=true; $(&q ...
- jQuery 判断checkbox是否被选中 4种方法
下午写JS验证,有一个需求需要判断 checkbox是否被选择,查阅相关资料后,总结以下4种方法,分享给大家. <!DOCTYPE html> <html lang="en ...
- jquery判断按钮是否被选中了
<script type="text/javascript"> function genjin_view2(elm){ if($(elm).attr("che ...
- JS实现全选与取消 Jquery判断checkbox是否被选中
1.JS实现checkbox全选与取消 <body> <input type="checkbox" name="select_all"/> ...
- Jquery判断单选框是否选中和获取选中的值
第一种:利用选中值判断选中 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http ...
- js和jquery判断checkbox是否被选中
js判断: if(document.getElementById("checkboxID").checked){ alert("checkbox is checked&q ...
- Jquery判断checkbox是否被选中
jQuery中: $("input[type='checkbox']").is(':checked') 返回true或false 1.attr()方法 设置或者返回备选元素的值 ...
- jquery 判断checkbox是否被选中问题
1.jquery库2以上 $("#checkbox_check").click(function(){ alert($(this).prop("checked" ...
- 每天学一点-Jquery判断checkbox是否为选中状态
if ($("#ctl00_ContentPlaceHolder1_IsLimitedService").attr("checked") ==true)
随机推荐
- 一个优秀windows C++程序员的知识体系
思考一个优秀windows C++ 程序员该有哪些知识,可最终发现什么知识都不能少, 看下图: 除了上面知识,程序员还要不断学习, 保持对新知识的热情. 转自http://www.cppblog.co ...
- ASP.NET Web API模型验证以及异常处理方式
ASP.NET Web API的模型验证与ASP.NET MVC一样,都使用System.ComponentModel.DataAnnotations. 具体来说,比如有:[Required(Erro ...
- ubuntu安装gitlab
#安装所有的依赖包 sudo apt-get install -y build-essential git-core sudo apt-get install -y zlib1g-dev libyam ...
- LeetCode:Container With Most Water,Trapping Rain Water
Container With Most Water 题目链接 Given n non-negative integers a1, a2, ..., an, where each represents ...
- C#转C++的一点分享
前几天看到这样一篇博客<那些年·我们读过的专业书籍>,里面列了很多大家认为很好的书,加上自己在自学C++的工程中也看了不少书,感觉并不是所有的书都值得花时间去看的,毕竟很多人一年下来也看不 ...
- sqlite 的比较等运算是根据不同的值而不同的,并不是根据的字段类型,因为 sqlite 是弱类型字段
sqlite 的比较等运算是根据不同的值而不同的,并不是根据的字段类型,因为 sqlite 是弱类型字段 --------------------------------------------- ...
- How to get the Current Controller Name, Action, or ID in ASP.NET MVC
public static class HtmlRequestHelper { public static string Id(this HtmlHelper htmlHelper) { var ro ...
- IOS CopyPNGFile 异常问题解决
今天突然出现一个编译问题,搞了我好久,这里不多说了.直接整理出来,记录下来! 问题描述如下图: 出现:CopyPNGFile 异常错误,Command /Applications/Xcode.app/ ...
- EPLAN 软件平台中的词“点“大全
1. 中断点(Interruption Point): 在原理图绘制时,如果当前绘图区域的空间不足,需要转到其它页面继续绘制,而这两页之间存在连续的"信息流"时,可以使用& ...
- MSIL 教程(二):数组、分支、循环、使用不安全代码和如何调用Win32 API(转)
转自:http://www.cnblogs.com/Yahong111/archive/2007/08/16/857574.html 续上文[翻译]MSIL 教程(一) ,本文继续讲解数组.分支.循环 ...