< >

cookie-local-storage.php


Quell Code


<div id="cookies">
  <div id="CookiesCheck">
    <div id="Cookieanimation">
      <div class="Cookiebackfenster"></div>
      <div class="Cookiefenster">
        <p class="CookieHeader">Cookies Hmmm... Lecker!</p>
        <ol class="cookiemenu">
          <strong><a href="Impressum.html">Impressum</a></strong>
          <div class="CookiesideHidden"><input type="checkbox" id="CookieCheck" onclick="cookiesCheck()">Zur Kenntnis
            Genommen
          </div>
        </ol>
        <div class="Cookies">
          <img src="img/Cookies.jpg" alt="Cookie Bild">
        </div>
      </div>
    </div>
  </div>
</div>
</body>
<script>
var elem = document.getElementById('cookies');
var cookiesCheck =function(){
    localStorage.setItem('consented', 'yes');
    elem.parentNode.removeChild(elem);
};
if (localStorage.getItem('consented')) {
    elem.parentNode.removeChild(elem);
}
  
</script>