The jQuery event timestamp property will return, when the event is triggered, the number of milliseconds since January 1 1970.
Syntax
event.timestamp
Parameter | Description |
event | Specifies the event to get the timestamp for. |
Basic Example
In the following jQuery example, the timestamp event's properties can be accessed to determine when an element was clicked. Try clicking the mouse icon below. The results will
be displayed in the div element next to the mouse icon.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#imgMouse").click(function (e) {
$("#div1").html("The click ... " + e.timeStamp);
});
});
</script>
</head>
<body>
<div id="div1">Click the mouse icon to the left!</div>
</body>
</html>
< Click the mouse icon to the left!
Please help us spread the word by socializing it today!
Did you find something wrong with the information on this page? Please take a moment to report it to us
so that we can continue to improve the quality of the information on this site. Click here to
report an issue with this page.
Recommended Books & Training Resources