Cookies Add/Remove - Ayush Shrestha || UI/UX || Front-end || Angular || React || Wordpress

Cookies Add/Remove

<script type=”text/javascript”>

jQuery(document).ready(function(){

var value = localStorage.getItem(‘hide_cookie_info’);
if (value) {
jQuery(“.notification-bar”).remove();

}
else {
jQuery(“.notification-bar”).show();

}

jQuery(‘#js_close_bar’).click(function () {

localStorage.setItem(‘hide_cookie_info’, true);
jQuery(‘.notification-bar’).remove();

});
});

</script>
<div class=”notification-bar” style=”display:none”>
<div class=”notification-bar__content”>
<button id=”js_close_bar” role=”button”> + </button>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.  <a href=”#” class=”btn-link”><u>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</u></a>.</p>
</div>
</div>

Related Blogs

Leave a Reply