HTMLElement: containerTiming property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

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

The containerTiming property of the HTMLElement interface marks the element as a container root for observation in the PerformanceContainerTiming API. The containerTiming property reflects the value of the containertiming attribute.

Value

A string.

Examples

Logging the value of containerTiming

In this example, adding the containertiming attribute to the <section> element sets it up as a container root.

html
<section containertiming="hero" id="hero-section">
  <!-- ... -->
</section>

You can get the string value of the containertiming HTML attribute by calling el.containerTiming.

js
const el = document.getElementById("hero-section");
console.log(el.containerTiming); // "hero"

For a more complete example on how to use the Container Timing API, see PerformanceContainerTiming.

Specifications

Specification
Container Timing API
# dom-htmlelement-containertiming

Browser compatibility

See also