i need to add cookies to my modal popup to be visible only once for user per browser session in all project web pages.
here is the HTML Code
<div id="popup">
<div class="modalconent">
<button id="button"><span class="close">×</span></button>
<h1></h1>
<p>Some text in the Modal..</p>
</div>
</div>
and here is my javascript code:
window.onload = function () {
document.getElementById('button').onclick = function () {
document.getElementById('popup').style.display = "none"
};
};
and here is my css code:
#modal {
position: fixed;
font-family: Arial, Helvetica, sans-serif;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.8);
z-index: 99999;
height: 100%;
width: 100%;
}
.modalconent {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #fff;
width: 80%;
padding: 20px;
}