Class DOM
The HTML DOM equivalent C# class object to define basic properties and perform the basic DOM operations.
Namespace: Syncfusion.Blazor
Assembly: Syncfusion.Blazor.dll
Syntax
public class DOM : Object
Constructors
DOM()
Declaration
public DOM()
Properties
ID
A unique ID of the HTML DOM element object.
Declaration
public string ID { get; set; }
Property Value
Type |
---|
System.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 |
---|---|---|
System.String[] | classList | An array of string CSS class to be added in the HTML DOM. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.String | attributeName | The attribute name to get the attribute value from the HTML element. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.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 |
---|---|
System.Threading.Tasks.ValueTask<System.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 |
---|---|---|
System.String[] | classList | An array of string CSS class to be removed in the HTML DOM. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.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 |
---|---|
System.Threading.Tasks.Task | Task. |
Type Parameters
Name | Description |
---|---|
T | The attribute value type. |