JSFiddle - React, Tailwind, and code Playground

by landau

JavaScript

// On ready

var events = [];
var dates = [];
$.ajax({
    url: "",
    data: {}
}).done(function(_events) {
    events = _events;
    $.ajax({
        url: ""
    }).done(function(_dates) {
        dates = _dates;

        // run code to show all events and dates
        populate();
    });
});

function populate() {
    // for each of the a tags or whatever you make,
    // bind a 'data-id="id"' to it so you can reference the event in the on click
}

// this div will contain your a tags and whatever
$("div").on("click", "a", function ( e ) {
    var $this = $(this),
        id = $this.attr("data-id");
        
});