JSFiddle - React, Tailwind, and code Playground

HTML

<div id="ubber">
    <div class="box">
        <p>Box </p>
        <button class="btn btn-danger remove-button">Remove</button>
    </div> <!-- box -->
</div> <!-- ubber -->

<button class="btn btn-success" id="addnew">add new box</button>

JavaScript

$(document).ready(function(){

    //add
        $('#addnew').on('click', function(){
            $('#ubber').append('<div class="box"><p>Box <span id="sum">0</span></p><button class="btn btn-danger remove-button">Remove</button></div> <!-- box -->');
        }); 

    //remove
        $(document).on('click' , '.remove-button', function(){
            $(this).closest('div').remove();
        })

    });