<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="js/jquery.min.js"></script>
</head>
<body>
<div class="checkbox">
    <input type="checkbox"/>
</div>
<div class="checkbox">
    <input type="checkbox"/>
</div>
<div class="checkbox">
    <input type="checkbox"/>
</div>
<div class="checkbox">
    <input type="checkbox"/>
</div>
<div class="checkbox">
    <input type="checkbox"/>
</div>
<div class="checkbox">
    <input type="checkbox"/>
</div>
<script type="text/javascript">
$(function(){
    $('.checkbox').find('input').click(function(){

        if($("input[type=checkbox]:checked").length >= 6)

        {

            $(this).removeAttr("checked");

            alert("最多选5个!")}

    });
})
</script>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-12-09
猜你喜欢
  • 2021-11-07
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2022-01-06
  • 2021-11-14
相关资源
相似解决方案