<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../jquery-3.5.1.min.js"></script>
  </head>
  <body>
    <button id="btn">点击我</button>
    <div id="test"></div>
    <script>
      $(function () {
        $("#btn")
          .bind("click", function () {
            $("#test").append("<p>我的绑定函数1</p>");
          })
          .bind("click", function () {
            $("#test").append("<p>我的绑定函数2</p>");
          })
          .bind("click", function () {
            $("#test").append("<p>我的绑定函数3</p>");
          });
        $("#btn").trigger("click");// 还未点击的时候先让他执行一遍
      });
    </script>
  </body>
</html>

 

相关文章:

  • 2021-10-09
  • 2021-07-03
  • 2021-09-30
  • 2022-12-23
  • 2021-06-26
  • 2022-03-06
  • 2021-07-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-06-08
  • 2021-07-26
相关资源
相似解决方案