JSFiddle - React, Tailwind, and code Playground

HTML

<table border=1 width=200>
    <tr>
        <td id="xxx">
            td 1
        </td>
        
    <tr>
        <td>
            td 2
        </td>
</table>

<input type="button" id="btn" value="click" />

JavaScript

jQuery(document).ready(function(){

    
    
    jQuery("input#btn").click(function(){
    
    jQuery("#xxx").after("<td id=\"xxy\">td 3 </td>");
        jQuery("#xxx").remove();
    
    })



})