> For the complete documentation index, see [llms.txt](https://playermaker.gitbook.io/componentbuilder/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://playermaker.gitbook.io/componentbuilder/english/html-attribute/htmlrole-attribute.md).

# HtmlRole Attribute

Only apply for component class

{% 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 %}
