JSFiddle - React, Tailwind, and code Playground

by Rafael Nepomuceno

HTML

<a class="class1 class2 class3" id="id_here">Some link</a>

CSS

a {
    text-decoration: underline;
    cursor: pointer;
}

JavaScript

$(document).on('click', 'a', function (e) {
    var firstDiv = $(this).children('div').first();
});

/* I need call function with first div */
$(firstDiv).click(function () {
    alert(firstDiv);
});

/* $(document).on('click', 'a', function (e) {
    var firstDiv = $(this).children('div').first();
    alert(firstDiv.attr('name');
}); */