> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extractbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# attribute

Retrieves the value of a specified attribute for the element.
Returns null if the attribute does not exist.
Example: `attribute(name: "href")` on an `<a>` tag, or `attribute(name: "data-custom")` on any element.

## Definition

```graphql theme={null}
attribute(
  name: String!
): String
```

## Arguments

### `name`

[String!](/reference/graphql/scalars/string)

The name of the attribute to retrieve. Example: `"class"`, `"id"`, `"value"`, `"src"`.

## Returns

[String](/reference/graphql/scalars/string)

The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

## Usage

This field is available on the [Page](/reference/graphql/objects/page) object. Use it to query page information and content.
