W3cubDocs

/Web APIs

Element: elementTiming property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The elementTiming property of the Element interface identifies elements for observation in the PerformanceElementTiming API. The elementTiming property reflects the value of the elementtiming attribute.

Value

A string.

Examples

Logging the value of elementTiming

In this example, adding the elementtiming attribute to the <img> element sets the image to be observed.

html

<img
  src="image.jpg"
  alt="a nice image"
  elementtiming="big-image"
  id="myImage" />

You can get the string value of the elementtiming HTML attribute by calling el.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, see PerformanceElementTiming.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
elementTiming 77 79 No No 64 No 77 77 No 55 No 12.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Element/elementTiming