JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container">
<input type="text" id="textBox" />
<a id="anchorTest" href="javascript: alert('inside anchorTest')">Click me</a>
</div>
JavaScript
$(document).ready(function () {
$('#anchorTest').click(function () {
alert('clicked');
});
$('#container').keyup(function (e) {
if (e.keyCode == 13) {
$('#anchorTest').click();
}
});
});