---
id: fast-element.attr_1
title: attr() function
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-element](./fast-element.md) &gt; [attr](./fast-element.attr_1.md)

## attr() function

Decorator: Specifies an HTML attribute.

<b>Signature:</b>

```typescript
export declare function attr(target: {}, prop: string): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  target | {} | The class to define the attribute on. |
|  prop | string | The property name to be associated with the attribute. |

<b>Returns:</b>

void
