.close
- наоборот, закрыть.const modal = document.querySelector('.modal');
const close = modal.querySelector('.close');
document.addEventListener('click', function(e) {
if (e.target === modal || e.target === close) {
modal.style.display = 'none';
}
if (e.target.tagName === 'BUTTON') {
modal.style.display = 'block';
}
});
const container = document.querySelector(".container");
container.onclick = function(){
container.classList.toggle("container_color_red");
}