an image gallery is a set of images with corresponding remove buttons
snippet in javascript

an image gallery is a set of images with corresponding remove buttons

user9776

function setup() {
    var els = document.getElementsByClassName("remove");
    for (var i = 0; i < els.length; i++) {
        els[i].addEventListener('click', function (e) {
            e.preventDefault();
            e.target.closest('div.image').remove();
        });
    }
}
setup();