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>