JSFiddle - React, Tailwind, and code Playground

HTML

<a href="#" id="link_to_content">Click Me</a>

JavaScript

$(document).ready(function () {

    $("#link_to_content").click(function (e) {
        e.preventDefault();
        alert("you clicked!");
    });
    $('#link_to_content').trigger('click');
});