JSFiddle - React, Tailwind, and code Playground

by Norlihazmey Ghazali

HTML

<table id="ao-referrer-summary">
    <thead>
        <tr>
            <th>Referrer First Name</th>
            <th>Referrer Last Name</th>
            <th>Delete User</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>%%FNAME%%</td>
            <td>%%LNAME%%</td>
            <td>
                <button class="btnDelete">&times;</button>
            </td>
        </tr>
        <tr>
            <td>%%FNAME%%</td>
            <td>%%LNAME%%</td>
            <td>
                <button class="btnDelete">&times;</button>
            </td>
        </tr>
    </tbody>
</table>

JavaScript

$(document).ready(function () {
    $("#ao-referrer-summary").on('click', '.btnDelete', function () {
        $(this).closest('tr').remove();
    });
});