HTMLElement.setCssProps method
HTMLElement › setCssProps
Official
Sets the CSS properties of the element.Signature:
setCssProps(props: Record<string, string>): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| props | Record<string, string> | The properties to set. |
Returns: void
Example:
const element = document.body.createEl('p');element.setCssProps({ color: 'red', 'font-size': '16px' });