Javascript examples for DOM:Event
The timeStamp event property when the event occured.
A Number, representing the number of milliseconds since midnight of January 1, 1970
The following code shows how to get the number of milliseconds since midnight of January 1, 1970:
<!DOCTYPE html> <html> <body> <p onclick="myFunction(event)">Click this paragraph.</p> <p>Timestamp: <span id="demo"></span></p> <script> function myFunction(event) {//from w w w . j ava 2 s . com var n = event.timeStamp; document.getElementById("demo").innerHTML = n; } </script> </body> </html>