MDN self-hosted library · e01.org

ViewTransition: transitionRoot property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const myElement = document.querySelector(".my-element");

// ...

function handleVT() {
  const vt = myElement.startViewTransition(() => {
    updateDOMSomehow();
  });

  // ...

  // Returns reference to myElement
  vt.transitionRoot;
}