手动实现一个outside

<div id='outside'></div>
#outside{
    width:400px;
    height:400px;
    background-color:yellow;
}

var oout=document.getElementById('outside')
window.addEventListener('mousedown',(e)=>{
    if(e&& e.path.includes(oout)){
        oout.style.background='blue'
    }else{
        oout.style.background='blue'
    }
})
上次更新:
作者: ganfengchi