const myElement = document.querySelector(".my-element");
// ...
function handleVT() {
const vt = myElement.startViewTransition(() => {
updateDOMSomehow();
});
// ...
// Returns reference to myElement
vt.transitionRoot;
}ViewTransition: transitionRoot property / notebook
ViewTransition: transitionRoot property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.