title: Change innerHTML based on date comparison
body: <p>I currently have the following code showing:</p>
  
  <pre><code>&lt;h1  id="header1" class="loginhead"&gt;Welcome to the &lt;%=formFields.getDisplayValue("programName")%&gt; Registration Site, .&lt;/h1&gt; 
  </code></pre>
  
  <p>I need to replace it with:</p>
  
  <pre><code>&lt;h1  id="header2" class="loginhead" &gt;The &lt;%=formFields.getDisplayValue("programName")%&gt; Registration Site, is now closed.&lt;/h1&gt; 
  </code></pre>
  
  <p>I need the replace to happen when the date and time are <code>7/15/15 11:59PM PT</code> </p>
  
  <p>Any way to do this using <strong>Jquery</strong>, <strong>JSP</strong> or <strong>Javascript</strong>?</p>
  
  <p>Update**</p>
  
  <pre><code>    &lt;h1  id="header" class="loginhead" &gt;&lt;span id='welcome'&gt;&lt;/span&gt;&lt;span id='welcome2'&gt;&lt;/span&gt; &lt;%=formFields.getDisplayValue("programName")%&gt; Registration Site &lt;span id='closed'&gt;&lt;/span&gt; &lt;/h1&gt; 
  &lt;script&gt;
   var now = new Date().getTime(); //Return the number of milliseconds since 1970/01/01:
  
  var epochTimeJul15_1159pm = 1437019199000; // number of milliseconds since 1970/01/01 at Jul 15_11:59:59pm. See http://www.epochconverter.com/.
  
  var timeTillChange = epochTimeJul15_1159pm - now;
  
  function changeHeader(){
      document.getElementById('closed').innerHTML = ' is now closed.'; //change the html/text inside of the span with the id closed'.
  }
  
  function changeHeader1()
  {
      if(epochTimeJul15_1159pm &lt;= now) 
      {
          document.getElementById('welcome').innerHTML = 'The ';
      }
  }
  
  function changeHeader2()
  {
      if(now &lt; epochTimeJul15_1159pm) 
      {
          document.getElementById('welcome2').innerHTML = 'Welcome to the '; 
      }
  }
  setTimeout(changeHeader, timeTillChange); //will wait to call changeHeader function until timeTillChange milliseconds have occured.
  setTimeout(changeHeader1, timeTillChange); 
  setTimeout(changeHeader2, timeTillChange);
  &lt;/script&gt;
  </code></pre>