Latest web development tutorials

jQuery event.timeStamp property

jQuery Event Methods jQuery Event Methods

Examples

It returns the number of milliseconds since January 1, 1970 when the button click event to occur:

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

try it"

Definition and Usage

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


grammar

event.timeStamp

参数 描述
event 必需。 event 参数来自事件绑定函数。


Examples

More examples

It shows the number of milliseconds since the last click event
It shows how to use event.timeStamp to display the number of milliseconds since the last click of the event.


jQuery Event Methods jQuery Event Methods