I've encountered this issue before, but I'm facing a problem this time. I'm attempting to create a popup that is initially hidden. When clicked, the popup does appear, but I'm unable to close it. Additionally, when trying to change the styles using developer tools from display:none to display:block, it automatically switches back. Currently, the popup is located in the head section of the page, but I have also tried placing it at the very bottom.
Here is the HTML code for the popup:
<div class="tablecell midlineunit popup-hml middle">
<div class="hml-popup-bg popupbg ">
<div class="hml-popup-cnt">
<div class="closepopup">X</div>
</div>
</div>
</div>
And here is the JavaScript associated with it:
$(".popup-hml").each(function(){
$(this).click(function(){
$(this).find(".hml-popup-bg").show();
});
});
$(".closepopup").each(function(){
$(this).click(function(){
$(this).parent().parent().hide();
});
});
Lastly, .hml-popup-bg has been styled as hidden in the CSS.