Home >>jQuery Tutorial >jQuery event.timeStamp Properties

jQuery event.timeStamp Properties

jQuery event.timeStamp Properties

jQuery event.timeStamp property in jQuery is an inbuilt and is used to returns the measure difference of milliseconds since 1st January, 1970, when the event is triggered.

Syntax:
event.timeStamp

Parameter Values

Parameter Description
event It is required parameter and is used to specify the event parameter comes from the event binding function
Here is an Example of jQuery event.timeStamp Property:

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".btn1").click(function(event){
$(".txt1").text(event.timeStamp);
});
});
</script>
</head>
<body>
<p> <span class="txt1" style="color:red">unknown</span> milliseconds after January 1, 1970.</p>
<button class="btn1">Click me</button>
</body>
</html>

Output:

unknown milliseconds after January 1, 1970.