jquery1.7.1

jquery判断checked

.attr('checked'):   //看版本1.6+返回:"checked"或"undefined" ;1.5-返回:true或false

html

 全选<input  />
 投资<input  />
 理财<input  />
 担当<input  />
 成熟<input  />

js

$(function(){
jQuery("#all").click(function(){
if($(this).attr("checked")==undefined){
$("input[name='test']").each(function(){
$(this).attr("checked",false);
});
}
else{
$("input[name='test']").each(function(){
$(this).attr("checked",true);
});
}
});
});

  

相关文章:

  • 2022-01-25
  • 2022-01-24
  • 2022-01-02
  • 2022-01-15
  • 2021-12-29
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2021-06-08
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案