renton88,
document.addEventListener("DOMContentLoaded", function() {
var popup = document.querySelectorAll(".popup"),
modal = document.querySelector(".modal"),
modalBtn = document.getElementById("btn-send"),
modalClose = document.querySelector(".modal-close");
[].forEach.call(popup, function(node, i) {
node.addEventListener("click", function() {
var html = "first block";
if (node.id == "type2") html = "new text";
document.querySelector(".first").innerHTML = html;
modal.classList.add("active")
})
});
modalClose.addEventListener("click", function() {
modal.classList.remove("active")
})
});