Designer API
Control the Webflow Designer
element.setTextContent(content)
Set text content for an element that supports text content.
1element.setTextContent(content: string): Promise<null>>
content
string
Promise<null>
null
A Promise that resolves to null.
1// Get Selected Element2const selectedElement = await Webflow.getSelectedElement()34if (selectedElement?.textContent) {56 // Set and print text content7 const text = await selectedElement.setTextContent("Lorem Ipsum")8 console.log(selectedElement.textContent)910}