-4

I want to display an HTML button after a definite time (5 days) and not uninitialized after each refresh for the web page

thank's in advance

BNJ
  • 108
  • 1
  • 8
  • You can use cookies for this. – Sandwell Apr 06 '18 at 11:54
  • 2
    At [so] you are expected to try to **write the code yourself**. After **[doing more research](//meta.stackoverflow.com/q/261592)** if you have a problem you can **post what you've tried** with a **clear explanation of what isn't working** and providing a [**Minimal, Complete, and Verifiable example**](//stackoverflow.com/help/mcve). I suggest reading [ask] a good question and [the perfect question](http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/). Also, be sure to take the [tour] and read **[this](//meta.stackoverflow.com/q/347937/)**. – John Conde Apr 06 '18 at 11:54

1 Answers1

1

There are two parts to this problem:

  1. Remembering the time when the button should appear
  2. Making the button appear at that time.

There are many different ways to do the former (e.g. cookies, local storage, a server-side script) but the latter is easiest accomplished with setTimeout.


If you had searched more deeply on Stack Overflow, you would have found these useful resources:

  • This question includes code for showing and hiding an element.
  • This question shows more than one way of storing data, such as the definitive time you mention in the question, so that it does not go away when you refresh.
  • This question explains how to read and write a date stored in the browser.
wizzwizz4
  • 6,140
  • 2
  • 26
  • 62