Back to Content

Element: elementTiming property

files/en-us/web/api/element/elementtiming/index.md

latest1.2 KB
Original Source

{{APIRef("DOM")}}{{SeeCompatTable}}

The elementTiming property of the {{domxref("Element")}} interface identifies elements for observation in the {{domxref("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 {{HTMLElement("img")}} element sets the image to be observed.

html

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 {{domxref("PerformanceElementTiming")}}.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("PerformanceElementTiming")}}
  • elementtiming HTML attribute