Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
How can I use cookies in JavaScript to set true or false data to close a popup permanently?

I was wondering if it was possible to use cookies in JavaScript to close a popup for cookie usage.

Is there any way to do it?

The code below sticks both of the pieces of code together as one entity, so it deletes both parts, while only trying to delete the popup part of it. I need to keep the <div id="e">© 2022 dont worry</div> part. Is there also a way to fix both issues at the same time or is that not possible?

My code:

<div id="sticky" class="alert-cookies">By using this search engine, you accept our use of cookies.<a href="#">Information</a>
    <href style="width: 100%">
    <input id='btn' type="submit" onclick = "deleter()" value='OK'>
    <script>
function deleter() {
    document.cookie = true;
    var btn = document.getElementById('btn');
btn.onclick = function () {
    document.getElementById('sticky').remove();
    this.remove();
    
};;
  }

 <div class="after footer_side1_wrapper">                     
                <div id="e">© 2022 dont worry</div> 
            </div>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda