# HtmlElementExtensions.WithId<THtmlElement>

Kind: Method  
Namespace: `TinyComponents`  
Assembly: `TinyComponents.dll`  
Source: https://docs.sisk-framework.org/api/TinyComponents.HtmlElementExtensions.WithId.html

## WithId&lt;THtmlElement>(THtmlElement, string) {#TinyComponents_HtmlElementExtensions_WithId__1___0_System_String_}

Specifies the HTML element ID of this [HtmlElement](https://docs.sisk-framework.org/api/TinyComponents.HtmlElement.md).

```csharp
public static THtmlElement WithId<THtmlElement>(this THtmlElement node, string id) where THtmlElement : HtmlElement
```

### Parameters

`node` THtmlElement

The current [HtmlElement](https://docs.sisk-framework.org/api/TinyComponents.HtmlElement.md).

`id` [string](https://learn.microsoft.com/dotnet/api/system.string)

The element ID.

### Returns

 THtmlElement

The self [HtmlElement](https://docs.sisk-framework.org/api/TinyComponents.HtmlElement.md) object for fluent chaining.

### Type Parameters

`THtmlElement` 

The object type which implements [HtmlElement](https://docs.sisk-framework.org/api/TinyComponents.HtmlElement.md).
