title: count up timer that record the time spent on the page
body: <p>i have a code that count up the time spent on the page it strat count up since it clicked now my problem is how to record the time when click on submit button and send it to the database</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt; script &gt;
    var minutesLabel = document.getElementById("minutes");
  var secondsLabel = document.getElementById("seconds");
  var totalSeconds = 0;
  setInterval(setTime, 1000);
  
  function setTime() {
    ++totalSeconds;
    secondsLabel.innerHTML = pad(totalSeconds % 60);
    minutesLabel.innerHTML = pad(parseInt(totalSeconds / 60));
  }
  
  function pad(val) {
    var valString = val + "";
    if (valString.length &lt; 2) {
      return "0" + valString;
    } else {
      return valString;
    }
  }
  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="navbar" class="collapse navbar-collapse"&gt;
   &lt;ul class="nav navbar-nav"&gt;
  &lt;label id="minutes"&gt;00&lt;/label&gt;:&lt;label id="seconds"&gt;00&lt;/label&gt;&lt;label id="houres"&gt;:00&lt;/label&gt;&lt;li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;input type="submit" name="register" class="btn btn-info" value="Submit" /&gt;</code></pre>
  </div>
  </div>
  </p>