Skip to content

@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

ParameterTypeDefault valueDescription
inputstringundefinedThe text to surround
tagNamestring'span'The name of the tag
attributesRecord<string, string>{}A dictionary of name value pairs to use for attributes

Returns

string

HTML tag with text