You could use `e.target.classList.contains('close-icon')` instead of the `attr` call here so this doesn't break if/when a second class is added to the close icon element.