Element: elementTiming property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
TheelementTiming property of theElement interface identifies elements for observation in thePerformanceElementTiming API. TheelementTiming property reflects the value of theelementtiming attribute.
In this article
Value
A string.
Examples
>Logging the value ofelementTiming
In this example, adding theelementtiming attribute to the<img> element sets the image to be observed.
html
<img src="image.jpg" alt="a nice image" elementtiming="big-image" />You can get the string value of theelementtiming HTML attribute by callingel.elementTiming.
js
const el = document.getElementById("myImage");console.log(el.elementTiming); // "big-image"For a more complete example on how to use the Element Timing API, seePerformanceElementTiming.
Specifications
| Specification |
|---|
| Element Timing API> # dom-element-elementtiming> |
Browser compatibility
See also
PerformanceElementTimingelementtimingHTML attribute