Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!