Class DOM
The HTML DOM equivalent C# class object to define basic properties and perform the basic DOM operations.
Inherited Members
Namespace: Syncfusion.Blazor
Assembly: Syncfusion.Blazor.dll
Syntax
public class DOM
Constructors
DOM()
Declaration
public DOM()
Properties
ID
A unique ID of the HTML DOM element object.
Declaration
[JsonPropertyName("id")]
public string ID { get; set; }
Property Value
| Type |
|---|
| string |
Methods
AddClass(string[])
Add a list of CSS classes to the HTML DOM element.
Declaration
public Task AddClass(string[] classList)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | classList | An array of string CSS class to be added in the HTML DOM. |
Returns
| Type | Description |
|---|---|
| Task | Task. |
GetAttribute<T>(string)
Get the attribute value from the HTML DOM element.
Declaration
public ValueTask<T> GetAttribute<T>(string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | The attribute name to get the attribute value from the HTML element. |
Returns
| Type | Description |
|---|---|
| ValueTask<T> | Returns the HTML attribute value with specific type. |
Type Parameters
| Name | Description |
|---|---|
| T | The result. |
GetClassList()
Get the CSS class names from the HTML DOM element.
Declaration
public ValueTask<string[]> GetClassList()
Returns
| Type | Description |
|---|---|
| ValueTask<string[]> | CSS class names in string of Array. |
RemoveClass(string[])
Remove a list of CSS classes in the HTML DOM element.
Declaration
public Task RemoveClass(string[] classList)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | classList | An array of string CSS class to be removed in the HTML DOM. |
Returns
| Type | Description |
|---|---|
| Task | Task. |
SetAttribute<T>(string, T)
Set the attribute to the HTML DOM element.
Declaration
public Task SetAttribute<T>(string attributeName, T attributeValue)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | The attribute name needs to be updated in the HTML element. |
| T | attributeValue | The attribute value needs to be updated to the corresponding attribute in the HTML element. |
Returns
| Type | Description |
|---|---|
| Task | Task. |
Type Parameters
| Name | Description |
|---|---|
| T | The attribute value type. |