Event listeners are attached to DOM elements on page load. You either need to reattach this one or you can listen for click events on the document
that target your button.
$(document).on('click', '#element-empty', function() {
$(this).addClass('myClass');
});
3
solved Can’t listen my new button with javascript [closed]