JSFiddle - React, Tailwind, and code Playground

by icampbell2

HTML

<div id = "a" onclick = "doSomething(event);">
    div "a"
    <div id = "b">
        div "b"
    </div>
    <div id = "c">
        div "c"
    </div>
</div>

JavaScript

function doSomething(e) {
    if (e.target.id !== "b") {
        alert(e.target.id);
    }
}