您的位置:首页 > Web前端 > JQuery

Jquery函数集锦

2015-11-23 14:03 513 查看
一、Jquery获取RadioButtonList选中值
方法1:

$(document).ready(function(){
alert($("#rbl").find("[checked]").val());
});


方法2:

$(document).ready(function(){
alert($("input[name='rbl']:checked").val());
});



二、Jquery移除事件

1.移除focus事件

$("#txtCustomer").unbind("focus");


2.移除所有事件

$("#txtCustomer").unbind();


3.只需触发一次事件,随后立即解除绑定

$("#txtCustomer").one("focus",function(){alert("只执行一次");});


三、Jquery判断CheckBoxList是否被选中
if ($("input:checked").length == 0) {
alert("未被选中");
}
else alert("被选中");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: