📜  mouseout 锚标记问题 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:20.188000             🧑  作者: Mango

代码示例1
function onMouseOut(event) {
        //this is the original element the event handler was assigned to
        var e = event.toElement || event.relatedTarget;
        if (e.parentNode == this || e == this) {
           return;
        }
    alert('MouseOut');
    // handle mouse event here!
}



document.getElementById('parent').addEventListener('mouseout',onMouseOut,true);