JSFiddle - React, Tailwind, and code Playground

by Prasad Gavande

HTML

<!-- change position of button .. change the divs of button 
 by append ---------->

<div id="panel1">
    <input type="button" value="add" id="btn1" />
    <br>
    <input type="button" value="add" id="btn2" />
    <br>
    <input type="button" value="add" id="btn3" />
</div>
<div id="panel2" style="background-color:gray"></div>

JavaScript

$("input[value='add']").click(function () {
    
    $(this).appendTo("#panel2");
    $(this).val("remove");
    $("#panel2").find("input[value='remove']").on("click", function () {
        $(this).appendTo("#panel1");
        $(this).val("add");
});


});