# Get Element Attribute

{% hint style="info" %}
**Block Information**

Available in: Page Flow

Toolbox Category: Html/DOM

Block Type: [Output](/app-editor/page-flow/block-anatomy.md#output-block)

Output Type: [*text*](/app-editor/page-flow/references/value-types.md)
{% endhint %}

**`Get Element Attribute`** is an [output block](/app-editor/page-flow/block-anatomy.md#output-block) that allows you to retrieve the value of any [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute) in elements on a page or form. The output is of type [*text*](/app-editor/page-flow/references/value-types.md) and is compatible with [Value Parameters](/app-editor/page-flow/block-anatomy.md#value-parameters) of type [*text*](/app-editor/page-flow/references/value-types.md) or of type [*any*](/app-editor/page-flow/references/value-types.md).

{% hint style="success" %}
Refer to the [Get Element Attribute in Data Design](/app-editor/page-flow/toolbox-blocks/get-element-attribute-in-data-design.md) block for dynamically generated content.
{% endhint %}

The block comes in two modes which are discussed below.

## Mode 1 <a href="#mode-1" id="mode-1"></a>

<div align="left"><figure><img src="/files/fG09G3bO8Qm6roN105uz" alt="" width="338"><figcaption><p>Get Element Attribute (Mode 1)</p></figcaption></figure></div>

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

* *Attribute:* [Input](/app-editor/page-flow/block-anatomy.md#input) configuration setting to specify the [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute) to retrieve the value of.
* *Element*: [Selectable Input](/app-editor/page-flow/block-anatomy.md#selectable-input) to choose the element you want to get the attribute of.

## Mode 2 <a href="#mode-2" id="mode-2"></a>

<div align="left"><figure><img src="/files/lCHDKAsOzuZ6ncR9SVYJ" alt="" width="338"><figcaption><p>Get Element Attribute (Mode 2)</p></figcaption></figure></div>

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

* *Attribute*: [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts a [*text*](/app-editor/page-flow/references/value-types.md) value representing the [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute) to set or change the value of.
* *Element*: [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts either a [*text*](/app-editor/page-flow/references/value-types.md) value in the form of a [CSS Selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors) or an [*element*](/app-editor/page-flow/references/value-types.md) value[.](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors) The Element block comes pre-attached for your convenience but can be removed and customized.

***

## 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](/app-editor/page-editor/built-in-elements/link.md#href) attribute of a [Link](/app-editor/page-editor/built-in-elements/link.md) element.

<div align="left"><figure><img src="/files/lSsePwATTWuU9KASgx0T" alt="" width="563"><figcaption><p>Example of Get Element Attribute Mode 1</p></figcaption></figure></div>

In the next example we see a Mode 2 version where the variable a is set to the value of the [href](/app-editor/page-editor/built-in-elements/link.md#href) attribute of the same [Link](/app-editor/page-editor/built-in-elements/link.md) element. This time the element is selected using a [CSS Selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors).

<div align="left"><figure><img src="/files/N3bvem9CPTnXbmdUFpGe" alt="" width="563"><figcaption><p>Example of Get Element Attribute Mode 2</p></figcaption></figure></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/get-element-attribute.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
