给div设置blur事件

来源:互联网 发布:网络拓扑算法 编辑:程序博客网 时间:2024/06/05 14:41
<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>Document</title>    <style>        .box{            width: 200px;            height: 200px;            background-color: #3295F2;        }    </style></head><body>    <div class="box" id="box" tabindex="1"></div>    <script>        document.getElementById('box').onblur = function(){            alert('div blur');        };    </script></body></html>

0 0
原创粉丝点击