Function: setStyleProps()
ts
function setStyleProps<T>(element, props): void;Sets the style properties of an HTML element.
Type Parameters
| Type Parameter |
|---|
T extends HTMLElement |
Parameters
| Parameter | Type | Description |
|---|---|---|
element | T | null | The element to set style properties on. |
props | Partial<{ [key: string]: string; }> | The style properties to set, in the form of an object of key-value pairs. |
Returns
void
void
Example
ts
const el = document.getElementById('myElement')
setStyleProps(el, { color: 'red', fontSize: '14px' })Since
1.0.0