Element Types & Methods
Element Types & Methods
Element Types & Methods
Each element in Webflow has a specific type that determines its functionality and available methods. While all elements share some common properties, each element type also has specialized methods that allow you to manipulate that element’s unique characteristics.
You can identify an element’s type using the element.type property:
To add a specific element type to the canvas, you can use the webflow.elementPresets object, which contains a set of presets for different element types available in the designer.
Different element types have unique methods tailored to their functionality. Always check an element’s type before applying type-specific methods.
Customize HTML elements with methods for HTML tags and attributes.
Work with text content and manipulate their text values.
Manage images and alt text.
Modify heading levels and heading content.
Configure links with methods for URLs, targets, and link settings.
Create and configure forms and form field settings.
Get components definitions from a component instance.
Always check element type before applying type-specific methods:
Handle multiple element types with type guards:
Combine property and type checks for maximum safety: