<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>购物车 全选</title>
<script src="http://www.aniu.tv/Public/Common/js/jquery.min.js"></script>
</head>
<script type="text/javascript">
$(function(){
$('.all').click(function(){
if($('.all').is(':checked')){
$('.check').prop('checked',true);
}else{
$('.check').prop('checked',false);

});
$('.check').click(function(){
var i = 0;
var arr = $('.check').length;
$('.check').each(function(){
if($(this).is(':checked')){
i++;
};
});
if(i == arr){
$('.all').prop('checked',true);
}else{
$('.all').prop('checked',false);
}

});
});
</script>
</head>
<body>
<input class="all" type="checkbox" > 
</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-24
  • 2021-05-07
  • 2021-05-04
  • 2021-12-22
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2021-04-02
  • 2021-06-20
  • 2021-09-21
相关资源
相似解决方案