JSFiddle - React, Tailwind, and code Playground

by shraddhapaghdar

HTML

<a onclick="doSomething()">Google</a>
<button type="button" id="trigger-btn">Trigger</button>

JavaScript

$('#trigger-btn').click(function(){
console.log("triggering")
  $("a").trigger("click");
});

function doSomething(){
    alert("Click event is triggered on the link.");
}