Hello. Tell me please. How to do what would be when you click on "Zone 1" and then on "Zone 2", and then on "Delete", only Zone 2 displayed an alert? I understand the event of clicking on the region-delit piling up, but I do not know how they can be cleaned up.
$('body').on('click', '.region-edit', function() { var text = $(this).text(); $('#del_btn').click(function() { alert(text); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button class="uk-button uk-button-primary uk-button-small region-edit">Зона 1</button> <button class="uk-button uk-button-primary uk-button-small region-edit">Зона 2</button> <button class="uk-button uk-button-primary uk-button-small region-edit">Зона 3</button> <button id="del_btn" class="uk-button uk-button-primary uk-button-small">Удалить</button>