JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<button id="parent" onclick="callFn(event, 'parent')">
<span id="child" onclick="callFn(event, 'child')">Authenticate</span>
</button>
</body>
JavaScript
window.callFn = function(evt, type) {
if (type === 'child') {
alert(type);
}
}