There are 2 modals on my website, but when I click on the second modal labeled "Mouthoff," it displays the contents of the Subscribe modal instead. I want each modal to display different content.
I have searched on various platforms including here and YouTube, but I am unable to find a solution.
// Get the modal
var modal = document.getElementById("subscription");
// Get the button that opens the modal
var btn = document.getElementById("subscribe");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks the button, open the modal
btn.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
...