const btn = document.getElementById ('share');
const modal = document.getElementById ('news_share');
btn.onclick = () => {
modal.classList.add("active");
modal.addEventListener("click", closeModal);
};
document.onclick = function(event){
var target = event.target
if(target != modal){
closeModal();
}
};
function closeModal() {
modal.removeEventListener("click", closeModal);
};