html timestamp

Solutions on MaxInterview for html timestamp by the best coders in the world

showing results for - "html timestamp"
Lara
09 Apr 2017
1<!DOCTYPE html>
2<html>
3<body>
4
5<h1>Event timeStamp</h1>
6
7<p>Click the button to get the number of milliseconds from this document was loaded until the button was clicked.</p>
8
9<button onclick="myFunction(event)">Click me!</button>
10
11<p>Time since this document was loaded: <span id="demo"></span></p>
12
13<script>
14function myFunction(event) {
15  var n = event.timeStamp;
16  document.getElementById("demo").innerHTML = n;
17}
18</script>
19
20</body>
21</html>
22