# HtmlRole Attribute

{% code title="Anchor.razor" %}

```cshtml
@inherits BlazorComponentBase
@attribute [HtmlRole("button")]

<a @attribute="@AdditionalAttributes">@ChildContent</a>

@code{    
    [Parameter]public RenderFragment? ChildContent { get; set; }
}
```

{% endcode %}

{% code title="Anchor.cs" %}

```csharp
public class Anchor : BlazorComponentBase, IHasChildContent
{
    [HtmlRole("button")]
    public Anchor()
    {
    }
    
    [Parameter]public RenderFragment? ChildContent { get; set; }
}
```

{% endcode %}

{% code title="Index.razor" %}

```cshtml
<Anchor></Anchor>

<a role="button"></a>
```

{% endcode %}
