Demo website for Bootstrap Cookie Banner. If you don't see the cookie banner below, clear the localstorage.

<!-- Cookie Banner -->
<div class="nk-cookie-banner alert alert-dark text-center mb-0" role="alert">
🍪 This website uses cookies to ensure you get the best experience on our website.
<a href="" target="blank">Learn more</a>
<button type="button" class="btn btn-primary btn-sm ms-3" onclick="window.nk_hideCookieAlert()">
I Got It
<!-- End of Cookie Banner -->
.nk-cookie-banner { position: fixed; bottom: 0px; left: 0px; width: 100%; z-index: 999; border-radius: 0px; display: none; }
/* Javascript to show and hide cookie banner using localstroage */
/* Shows the Cookie banner */
function showCookieBanner(){
let cookieBanner = document.getElementsByClassName("nk-cookie-banner")[0]; = "block";
/* Hides the Cookie banner and saves the value to localstorage */
function hideCookieBanner(){
localStorage.setItem("web_dev_isCookieAccepted", "yes");
let cookieBanner = document.getElementsByClassName("nk-cookie-banner")[0]; = "none";
/* Checks the localstorage and shows Cookie banner based on it. */
function initializeCookieBanner(){
let isCookieAccepted = localStorage.getItem("web_dev_isCookieAccepted");
if(isCookieAccepted === null)
localStorage.setItem("web_dev_isCookieAccepted", "no");
if(isCookieAccepted === "no"){
// Assigning values to window object
window.onload = initializeCookieBanner();
window.nk_hideCookieBanner = hideCookieBanner;