I have a Div that should open up a popup with its innerHTML content. However, the click only works once on the same Div. I can click Div 2 and the popup will open, but I want to be able to open Div 1 after Div 1 has been clicked and closed.
Also, if I click the link inside the popup and close the window, Div 1 and Div 2 do not open up the popup anymore.
How to make it so the popup opens again with the content after clicking the same Div, after the popup has closed?
Pure javascript preferred
Minimum example: https://jsfiddle.net/ta4802/9x2Lg3wn/
<div class="m1" onclick="basicPopup('',this);">Text text text text
<p> <a href="http://stackoverflow.com">Link 1</a> </p>
</div>