JSFiddle - React, Tailwind, and code Playground

HTML

<div id="e">
    <div id="a">A</div>
    <div id="b">B</div>
    <div id="c">C</div>
</div>

CSS

#e{
    width:300px;
    height:200px;
    background:red;
}
#e div {
    width:100px;
    float:left;
    height:200px;
    background:blue;
}

JavaScript

document.getElementById("e").addEventListener("click", function(e) {
    var index = Array.prototype.indexOf.call(this.children, e.target);
    console.log(index);
});