jQuery Event - timeStamp Attribute

Example

Display the timestamp when the click event occurs on the button element:

$("button").click(function(event){
  $("span").html(event.timeStamp);
});

Try It Yourself

Definition and Usage

The timeStamp property contains the number of milliseconds from January 1, 1970, to the time the event is triggered.

Syntax

event.timeStamp
Parameter Description
event Required. Specifies the event to return the timestamp for. This event Parameters come from the event binding function.