title: localStorage how to save countdown value so it wont reset when I reload the page
body: <p>When I reload the page, my 1 minute countdown also reloads. 
  I tried to use <code>localStorage</code> but it seems to me failed. 
  Please have a look, I do not know where I should fix.</p>
  
  <p>Thank you</p>
  
  <p>My script</p>
  
  <pre><code>        /* for countdown */
      var countDown = (function ($) {
          // Length ms
          var timeOut = 10000;
          // Interval ms
          var timeGap = 1000;
  
          var currentTime = (new Date()).getTime();
          var endTime = (new Date()).getTime() + timeOut;
  
          var guiTimer = $("#clock");
          var running = true;
          var timeOutAlert = $("#timeout-alert");
          timeOutAlert.hide();
  
          var updateTimer = function() {
              // Run till timeout
              if(currentTime + timeGap &lt; endTime) {
                  setTimeout( updateTimer, timeGap );
              }
              // Countdown if running
              if(running) {
                  currentTime += timeGap;
                  if(currentTime &gt;= endTime) { // if its over
                      guiTimer.css("color","red");
                  }
              }
              // Update Gui
              var time = new Date();
              time.setTime(endTime - currentTime);
              var minutes = time.getMinutes();
              var seconds = time.getSeconds();
  
              guiTimer.html((minutes &lt; 10 ? '0' : '') + minutes + ':' + (seconds &lt; 10 ? '0' : '') + seconds);
  
              if (parseInt(guiTimer.html().substr(3)) &lt;= 10){ // alert the user that he is running out of time
                  guiTimer.css('color','red');
                  timeOutAlert.show();
              }
  
          };
  
          var pause = function() {
              running = false;
          };
  
          var resume = function() {
              running = true;
          };
  
          var start = function(timeout) {
              timeOut = timeout;
              currentTime = (new Date()).getTime();
              endTime = (new Date()).getTime() + timeOut;
              updateTimer();
          };
  
          return {
              pause: pause,
              resume: resume,
              start: start
          };
      })(jQuery);
  
      jQuery('#break').on('click',countDown.pause);
      jQuery('#continue').on('click',countDown.resume);
  
      var seconds = 60; // seconds we want to count down
      countDown.start(seconds*1000);
  </code></pre>
  
  <p>I tried to fix it but I dont know where/how to put localStorage.</p>