JSFiddle - React, Tailwind, and code Playground
by xu xiaofei
HTML
<div id="out">
<div id="inner"></div>
</div>
CSS
div{
position:relative;
width:200px;
height:200px;
background:#666;
}
div div{
position:absolute;
margin:auto;
top:0;
bottom:0;
left:0;
right:0;
width:100px;
height:100px;
background:#ccc;
}
JavaScript
let out = document.getElementById('out')
let inner = document.getElementById('inner')
inner.addEventListener('click',()=>{
for(var i=0;i<10000;i++){}
console.log('done')
})
out.addEventListener('click',()=>{
console.log('out done')
})