JSFiddle - React, Tailwind, and code Playground

by oysteinmoseng

HTML

<div class="a">

</div>
<div class="b">

</div>

CSS

.a {
    width: 100px;
    height: 100px;
    background-color: red;
    cursor: pointer;
}

.b {
    width: 40px;
    height: 40px;
    background-color: green;
    position: absolute;
    top: 0;
    pointer-events: none;
}

JavaScript

document.querySelector('.a').onclick = () => alert('hey')