@technobuddha > library > String > Construction
Function: tag()
ts
function tag(
input: string,
tagName: string,
attributes: Record<string, string>): string;Defined in: tag.ts:14
Surround text with an HTML tag
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
input | string | undefined | The text to surround |
tagName | string | 'span' | The name of the tag |
attributes | Record<string, string> | {} | A dictionary of name value pairs to use for attributes |
Returns
string
HTML tag with text