给div设置blur事件

    xiaoxiao2021-12-12  6

    <!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>
    转载请注明原文地址: https://ju.6miu.com/read-900311.html

    最新回复(0)