JSFiddle - React, Tailwind, and code Playground

by Daedalus

HTML

<table id="wb_i" border="1">
    <tr>
        <td id="dd" class="dd1">
            <div id="x" class="y"> <a href="aaa" id="m" class="aa">Test</a></div>
        </td>
    </tr>
    <tr>
        <td id="dd1" class="dd1">
            <div id="x1" class="y"> <a href="aaa" id="m1" class="aa">Test</a></div>
        </td>
    </tr>
</table>

JavaScript

jQuery.noConflict()(function(jQ) {
    "use strict";

    //Process each table cell in the roster
    jQ("#wb_i").click(function(event) {
        console.log(jQ(event.target)); //the anchor element(if the anchor was clicked)
        console.log(jQ(event.target).closest("td")); //the td element
        console.log(jQ(event.target).find("a")); //the anchor element(if the div was clicked)
    });
    jQ("a").click(function(e) {
        e.preventDefault();
    });
});