![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
jQuery event.timeStamp property with Example
The event.timeStamp property in jQuery is used to return the number of milliseconds since January 1, 1970, when the event is triggered.
Syntax
The syntax is as follows −
event.timeStamp
Example
Let us now see an example to implement the jQuery event.timeStamp property −
<!DOCTYPE html> <html> <head> <style> .demo { color: white; background-color: black; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(event){ $("span").text(event.timeStamp); }); }); </script> </head> <body> <h2>Milliseconds January 1, 1970</h2> <p>Event occurred <span class="demo">0</span> milliseconds after January 1, 1970.</p> <button>Milliseconds</button> </body> </html>
Output
This will produce the following output −
Click on the button “Milliseconds” above −
Advertisements