JSFiddle - React, Tailwind, and code Playground
HTML
<div onclick="alert('div!');">
XXXX
<a id="thelink" href="javascript:void(0);">Hello</a>
XXXX
</div>
JavaScript
document.getElementById("thelink").onclick = function (e) {
window.open();
if (e.stopPropogation)
e.stopPropogation();
if (e.cancelBubble != null)
e.cancelBubble = true;
};