Hopefully someone here can help me out or at least give me some good pointers.
I am working with the modals from the Codepen https://codepen.io/scottohara/pen/OEeBJe. That code works just fine but I need to use multiple modals and this code is only for 2.
I can add variables like this but this will get out of hand
var btn3 = document.getElementById('m-button3');
var btn4 = document.getElementById('m-button4');
var dialog3 = document.getElementById('m-dialog3');
var dialog4 = document.getElementById('m-dialog4');
these functions that revert the HTML to normal upon close will also need to be consolidated:
btn.addEventListener('click', function () {});
btnClose.addEventListener('click', function () {});
Is this the best code to use or can you suggest another?