JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" onclick="alert('Link was clicked');return false" id="myHrefLink">My HREF Link</a>
<br /><br />
<div id="clicker" onclick="clickLinkDynamically();">Click here to dynamically click on the link</div>
CSS
#clicker {
padding: 10px;
border: 2px solid grey;
background-color: lightgrey;
cursor:pointer;
}
JavaScript
function clickLinkDynamically() {
$('#myHrefLink').click();
}