HTML DOM timeStamp Event Property Last Updated : 30 Sep, 2024 Comments Improve Suggest changes Like Article Like Report The timeStamp property in the HTML DOM refers to a read-only property that returns the time (in milliseconds) at which an event was created. The value is measured relative to the UNIX epoch (January 1, 1970, 00:00:00 UTC). This property is commonly used to determine the timing of events and can be useful for performance analysis, event tracking, or synchronizing animations.Syntax:event.timeStampReturn Value: This event returns the number of milliseconds since January 1, 1970 and when the event is triggered. Example: The below example captures the event's timestamp when a button is clicked, showing the time (in milliseconds since January 1, 1970) using the timeStamp property and displaying it inside a paragraph. html <!DOCTYPE html> <html> <head> <title>DOM timeStamp Event Property Example</title> </head> <body style="text-align:center"> <h2>DOM timeStamp Event Property</h2> <p> <button onclick="showTimestamp(event)"> Click me </button> </p> <p> The event occurred <span id="timestampDisplay" style="color:green"> N/A </span> milliseconds after January 1, 1970. </p> <script> function showTimestamp(event) { // Get the event's timestamp let timeStamp = event.timeStamp; // Display the timestamp in the span document.getElementById("timestampDisplay").innerHTML = timeStamp + " milliseconds"; } </script> </body> </html> Output:Supported Browsers: The browser supported by timeStamp Event property are listed below: Apple Safari Google Chrome Firefox Opera Comment More infoAdvertise with us Next Article HTML DOM timeStamp Event Property V Vishal Chaudhary 2 Follow Improve Article Tags : Web Technologies HTML HTML-DOM HTML-Property Similar Reads HTML DOM removeAttributeNode() Method The DOM removeAttributeNode() method is used to remove the specified attribute from the current element. It is similar to removeAttribute() method but the difference is that the removeAttribute method is used to remove the attribute with the specified name, but on the other hand removeAttributeNode 1 min read HTML DOM Superscript Object The superscript object in HTML DOM is used to represent the HTML <sup> element. The superscript element can be accessed by using getElementById(). Syntax: document.getElementById("id") Where id is assigned to the <sup> tag. Example: In this example, we will use DOM Superscript Object HTM 1 min read HTML DOM replaceChild() Method The replaceChild() method in HTML DOM is used to replace a child node with a new node within the given parent node. Syntax: parentNode.replaceChild( newChild, oldChild ) Parameter Values: This method accepts two parameters which are listed below: newChild: It is the required parameter. It represents 1 min read HTML DOM Subscript Object The Subscript Object in HTML DOM is used to represent the HTML <sub> element. The subscript element can be accessed by using the getElementById() method. Syntax: document.getElementById("id") Where id is assigned to the <sub> tag. Example 1: In this example, we will use DOM Subscript Obj 1 min read HTML | DOM Fieldset Object The DOM Fieldset Object is used to represent the HTML <fieldset> element. The fieldset element is accessed by getElementById(). Properties: disabled: disabled property used to set or return whether a fieldset is disabled, or not.form: use to return a reference to the form that contains the fie 2 min read HTML DOM Figure Object The DOM Figure Object is used to represent the HTML <figure> element. The figure element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where âidâ is the ID assigned to the âfigureâ tag. Example 1: In this example, we will use DOM Figure Object. HTML <!DOCTYPE html 2 min read HTML DOM Section Object The Section Object in HTML DOM is used to represent the HTML <section> element. The section element can be accessed by using the getElementById() method. Syntax: document.getElementById("id") Where id is assigned to the <section> tag. Example 1: In this example, we will use DOM Section O 1 min read HTML DOM Nav Object The DOM nav object is used to represent the HTML <nav> element. The<nav> element is accessed by getElementById(). Syntax: document.getElementById("id") Where id is assigned to the <nav> tag. Note: The Nav Object is not supported by Internet Explorer 8 and earlier versions. Example 1 min read HTML DOM insertAdjacentText() Method The insertAdjacentText() inserts a provided text at one of the following positions. afterbegin:afterend:beforebegin:beforeend: Syntax: node.insertAdjacentText(position, text) Parameters: This method requires 2 parameters. position: A position relative to the element. The legal values are:afterbegin: 1 min read HTML DOM Style borderImage Property The DOM Style borderImage Property in HTML is a shorthand property used for setting the borderImageSource, borderImageSlice, borderImageWidth,borderImageOutset, and borderImageRepeat properties. Syntax: It is used to return the borderImage property. object.style.borderImageIt is used to set the bord 2 min read Like