JSFiddle - React, Tailwind, and code Playground

HTML

<table>
        <tr>
            <td><a href="javascript:void(0)" id="aTag">TEST</a></td>
        </tr>
    </table>

JavaScript

function showAlert (text) {
        alert(text);
    }

    x = document.getElementById('aTag');
    x.onclick = function() {showAlert("foo");};