From 7e0f7c2148f2e5ae273627270886255d2f63417f Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Fri, 17 Apr 2026 10:03:51 -0400 Subject: [PATCH] DEVREL-2821: Get and set ID --- src/examples/elements.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/examples/elements.ts b/src/examples/elements.ts index 4d5974f..4b2e27d 100644 --- a/src/examples/elements.ts +++ b/src/examples/elements.ts @@ -1248,5 +1248,26 @@ export const Elements = { console.log('Selected element does not support setSettings.') } }, + + getDomId: async () => { + const element = await webflow.getSelectedElement(); + + if (element?.domId) { + + // Get the current DOM ID + const id = await element.getDomId(); + console.log(id); + } + }, + + setDomId: async () => { + const element = await webflow.getSelectedElement(); + + if (element?.domId) { + + // Set a static ID + await element.setDomId('hero-section'); + } + }, }, }