Designer API
Control the Webflow Designer
element.setTag(tag)
Set the value of the specified HTML tag of the DOMElement.
This method also works on other Webflow elements; see Set HTML tag.
1element.setTag(tag: string): Promise<null>
string
Promise<null>
null
A promise that resolves to null
1// Get Selected Element2const selectedElement = await webflow.getSelectedElement();34if (selectedElement?.children) {56 // Create and append DOM Element7 const DOMElement = await selectedElement.append(webflow.elementPresets.DOM);8 console.log(DOMElement)910 // Set Tag11 await DOMElement?.setTag('img');12 const tag = await DOMElement.getTag()13 }