<!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>click</title>
    <script type="text/javascript" src='jquery-2.2.0.min.js'></script>
    <style type="text/css">
        div{
            width:200px;
            height:200px;
            background-color:red;
        }
    </style>
</head>
<body>
<div class='box'>
    hello
</div>
<div class='box box1'>
    hello
</div>
</body>
<script type="text/javascript">
    $('.box').click(function(){
        alert(1111);
    })
    $('.box.box1').click(function(){
        alert(3333)
    })
</script>
</html>

点击.box会出现1111

点击.box.box1的时候出现1111  3333弹出两次

相关文章:

  • 2021-07-27
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2023-03-08
猜你喜欢
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案