JSFiddle - React, Tailwind, and code Playground
HTML
<a id="WebTree" href="javascript:alert('testing')">click me</a>
JavaScript
$(document).ready(function(){
$('#WebTree').trigger('click');
$('#WebTree').click(function() {
alert(1);
});
// after the page load I'm expecting to see the alert but it's not working
});
$(window).load(function () {
$('#WebTree').click();
});