JSFiddle - React, Tailwind, and code Playground
HTML
<div id="first">
<div id="second">
<div id="third">Click me!</div>
</div>
</div>
JavaScript
var first = document.getElementById('first'),
second = document.getElementById('second'),
third = document.getElementById('third');
third.addEventListener('click', function (e) {
alert('third');
});
second.addEventListener('click', function (e) {
alert('second');
e.stopPropagation();
});
first.addEventListener('click', function (e) {
alert('first');
});