JQuery实现radio、select、checkbox禁用
2021-06-19 09:03
标签:lan art tar change query func dai sdn checkbox var input = $("#appDIV").find("input:radio"); this.s = this.selectedIndex||0; $("#selectItem").attr("disabled","disabled"); }); //以上方法都可以实现 $(this).find("select,:radio,:checkbox").attr("disabled", "disabled"); 这样也可以直接实现! 转自:http://blog.csdn.net/hongleidy5000/article/details/6265488 JQuery实现radio、select、checkbox禁用 标签:lan art tar change query func dai sdn checkbox 原文地址:http://www.cnblogs.com/ourLifes/p/7193626.html
input.attr("disabled","disabled");
input.each(function(){
if($(this).val()==2){
$(this).attr("checked",true);
}
});
var checkbox = $("#ce").find("input:checkbox");
checkbox.attr("disabled","disabled");
checkbox.each(function(){
if($(this).val()=="Monthly"){
$(this).attr("checked",true);
}
});
$("#selectItem option:disabled").css(‘color‘, ‘#CCC‘);
$(‘#selectItem‘).change(function(){
if(this[this.selectedIndex].disabled){
this.selectedIndex = this.s||0;
}else{
}
});
1
2
3
Dairy
Weekly
Monthly
下一篇:HTTP连接池
文章标题:JQuery实现radio、select、checkbox禁用
文章链接:http://soscw.com/index.php/essay/95876.html