Designer API
Control the Webflow Designer
element.setText(text)
Sets the text value on a String element, overwriting any prior text value.
1element.setText(text: string): Promise<null>
string
StringElement
Promise<null>
null
A Promise that resolves to null.
1// Get all elements and find the first StringElement2const allElements = await webflow.getAllElements();3const foundElement = allElements.find(el => el.type === "String");45if (foundElement) {6 // Check that element has the method in order to use it7 if ('setText' in foundElement) {8 const elementText = foundElement.setText("Hello Element 🚀"); // Set Text9 }10} else {11 console.log('Element not found on page');12}