I'm trying to make simple cookie bar.
Here's my code.
#cookie-bar-bottom {
bottom: 0;
}
.cookie-bar {
width: 100%;
line-height: 30px;
left: 0;
position: fixed;
z-index: 100;
background-color: rgba(0,0,0,0.70);
}
.cookie-content {
color: white;
text-align: center;
padding-top: 10px;
}
.cookie-hide {
margin-left: 80px;
text-decoration: none;
background-color: black;
color: white;
border: 1px solid white;
outline: none;
}
.cookie-hide:hover {
background-color: #155670;
}
<div id="cookie-bar-bottom" class="cookie-bar">
<div class="cookie-content">
<p>
We use cookies to enhance your experience in our web site. By visiting it, you agree our <a href="#" class="cookie-policy">Cookies Policy</a>.
<input id="cookie-hide" class="cookie-hide" onclick="this.parentNode.parentNode.style.display = 'none'" value="I understand" type="button">
</p>
</div>
</div>
It closes when I hit 'I understand' button. The problem is with that close button because when I refresh my website cookie bar appears again. I wouldn't like to see it when I'm refreshing my website.
I don't want to use any PHP function btw. it should be - I think, java/jQuery script/function, and should work with my structure of cookie bar code.