惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
博客园 - 司徒正美
V
Visual Studio Blog
博客园 - 【当耐特】
T
Tailwind CSS Blog
美团技术团队
博客园 - 叶小钗
Jina AI
Jina AI
宝玉的分享
宝玉的分享
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC

博客园 - *小小黄*

List<T>的Sort,Find,Exists等的使用(摘抄) 使用Telerik控件时出现Failed to create designer 的解决方法 GridView 笔记 - *小小黄* - 博客园 Telerik Rad 笔记 一 Silverlight学习笔记四:如何通过自定义ComboBox实现SelectedValue Silverlight学习笔记三:如何自定义DataGrid的Header Silverlight学习笔记二(续) Silverlight学习笔记二:DataGrid 服务器端分页、排序的实现 Silverlight学习笔记一:DataGrid如何处理鼠标的滚轮事件 SQL2005快照 在ASP.NET中使用HTTP压缩 Web注册表单设计样式的研究(下) Web注册表单设计样式的研究(上) 禁用aspx页面的客户端缓存 DataGrid中没有数据时显示表头(转) 在 Windows Vista 上安裝 Reporting Services IIS7中访问Access数据库报错的解决方案 解决“无法删除文件:无法读源文件或磁盘” AjaxControlToolkit中的CalendarExtender被遮挡的解决方法
JQuery常用代码1
*小小黄* · 2011-03-25 · via 博客园 - *小小黄*

//选择被选中Radio的Value值
$("input[name='radio_name'][checked]").val();

//根据Value值设置Radio为选中状态
$("input[name='radio_name'][value='要选中Radio的Value值'").attr("checked",true); 

//选择被选中CheckBox元素的集合 如果你想得到Value值你需要遍历这个集合
$("input[name='checkbox_name'][checked]");

//遍历被选中CheckBox元素的集合 得到Value值
$($("input[name='checkbox_name'][checked]")).each(function(){arrChk+=this.value + ',';});

//获取一个CheckBox的状态(有没有被选中,返回true/false)
$("#checkbox_id").attr("checked");

//设置一个CheckBox的状态为选中(checked=true)
$("#checkbox_id").attr("checked",true);

//设置一个CheckBox的状态为不选中(checked=false)
$("#checkbox_id").attr("checked",false);

$("input[name='checkbox_name']").attr("checked",$("#checkbox_id").attr("checked"));

//事件 当对象text_id获取焦点时触发
$("#text_id").focus(function(){//code...}); 

//事件 当对象text_id失去焦点时触发
$("#text_id").blur(function(){//code...});

//使文本框的Vlaue值成选中状态
$("#text_id").select();

 //ListBox 获取当前选择的值

var text = $("#lbRoom option:selected").text();
var value = $("#lbRoom option:selected").val();