I want when I click on add to add an elements in the .items
and then when I click "remove" remove it but it doesn't work
$('.add').on('click', function () {
$('.items').append('<span class="rmv">remove</span>');
});
$('.rmv').on('click', function() {
$(this).remove();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="items"></div>
<div>
<span class="add">add</span>
</div>