0

body {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.welcome {
  width: 220px;
  display: flex;
  align-items: center;
  padding: 10px;
  border: 1px solid #ccc;
}
.welcome button {
  margin-left: 10px;
}
<div class="welcome" id="popup">
  welcome to this site
  <button class="ok" >I got it!</button>
</div>

I want to use the cookie method to make a window appear once when the user comes to the website. When the user clicks the "I know" button

, the window can be closed. When he comes to the website next time, it will not appear again. welcome window, how can this be done through cookies?

PS. I have searched for other methods, but I prefer to know how to do it through cookies, because this is the method I don't know much about, thank you all.

AWEI
  • 417
  • 3
  • 9

0 Answers0