JSFiddle - React, Tailwind, and code Playground

HTML

<table>
    <tr>
        <td class="selectable" id="shoes-123" ><input type="text" value="foo" /></td>
        
        <td><a href="?shoes=<?php  echo $color->id; ?>" title="Select">link</a></td>
    </tr>
</table>

CSS

td {
    border: 1px solid #000;
    padding: 5px;
}

JavaScript

$('td a').click(function(e) {
    e.preventDefault();
    greenlight = false;
    link = $(this);
    href = $(this).attr("href");
    row = $(this).closest('tr');
    if ($(":text", row).length > 0) {
    new-email = jQuery.trim($(":text", row).val());
    alert(new_email);
    //do stuff here
}
});