Запись в куки после нажатия на кнопку?
Нужно что бы после нажатия на кнопку запись шла в куки, и после не открывалась окно. Находил похожие вопросы, но ничего не понял :/ Пожалуйста помогите
html
<div class="notify__modal" id="notify__modal">
<div class="notify__modal-content">
<h1 class="notify__modal-title">вам есть 18 лет?</h1>
<button id="notify_btn" class="notify__accept">Да,</button>
<button >Нет</button >
</div>
</div>
js
const notify = (toggleId, navId) =>{
const toggle = document.getElementById(toggleId),
nav = document.getElementById(navId)
if(toggle && nav){
toggle.addEventListener('click', ()=>{
nav.classList.add('hide')
})
}
}
notify ('notify_btn','notify__modal')