其他分享
首页 > 其他分享> > jquery事件解绑

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>

标签:jquery,function,unbind,box,事件,解绑,document,click
来源: https://www.cnblogs.com/zhangxuechao/p/13861661.html