String Element
The String element represents a string value within the Webflow Designer.
String elements cannot be created directly, and are only created as a side effect of creating other element presets that contain text content (e.g. webflow.elementPresets.FormBlockLabel
).
See methods below you to retrieve and set the text of a String element.
Properties
Methods
element.getText()
Retrieves the text value from a String element
Syntax
Returns
Promise<string
>
A Promise that always resolves to a String value
- String Contents of the string element, which may be an empty string.
Example
Designer Ability
Checks for authorization only
element.setText(text)
Sets the text value on a String element, overwriting any prior text value.
Syntax
Parameters
- text:
string
- The new text for yourStringElement
Returns
Promise<null
>
A Promise that resolves to null
.