jquery事件解绑

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title></title>
        <script src="jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>

        <script type="text/javascript">
            $(document).ready(function() {
                $(document).click(function() {
                    alert("click")
                });

                $(document).unbind("click");
                $(document).unbind("mouseenter");
                $(document).undelegate("#box", "click");
                $(document).off("click", "#box");
            });
        </script>
    </head>
    <body>
        <div id="box">
        </div>
    </body>
</html>
posted @ 2020-10-22 23:24  thomas_blog  阅读(78)  评论(0编辑  收藏  举报