Get Element Attribute

Block Information

Available in: Page Flow

Toolbox Category: Html/DOM

Block Type: Output

Output Type: text

Get Element Attribute is an output block that allows you to retrieve the value of any HTML attribute in elements on a page or form. The output is of type text and is compatible with Value Parameters of type text or of type any.

Refer to the Get Element Attribute in Data Design block for dynamically generated content.

The block comes in two modes which are discussed below.

Mode 1

The Mode 1 version of the Get Element Attribute block consists of (from left to right):

  • Attribute: Input configuration setting to specify the HTML attribute to retrieve the value of.

  • Element: Selectable Input to choose the element you want to get the attribute of.

Mode 2

The Mode 2 version of the Get Element Attribute block consists of (from left to right):


Usage Examples

The image below shows an example of the Mode 1 version where the variable a is set to the value of the href attribute of a Link element.

In the next example we see a Mode 2 version where the variable a is set to the value of the href attribute of the same Link element. This time the element is selected using a CSS Selector.

Last updated