JSFiddle - React, Tailwind, and code Playground

by Prasad Gavande

HTML

<!-- chage the position of the button and name with classToggle -->
<div id="panel1" class="p1">
    <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 class="p2"></div>

CSS

.p1 {
}
.p2 {
    position:fixed;
    /* top:30px;
    right:20px;*/
}

JavaScript

$("input").click(function () {
    $(this).toggleClass("p2");
    $(this).css("right", "20px");
    if ($(this).val() == "add") {
        $(this).val("Remove");
    } else {
        $(this).val("add");
    }
});