Sets or gets the plain-text content of a TextMask element.

Setting the text property sets the plain-text content of the TextMask.

Getting the text property returns the plain-text content of the TextMask.

The text property's value can contain multiple lines of text. Note that the text doesn't automatically wrap, as the TextMask element renders text as an SVG, rather than as an HTML element. As a result, to set multiple lines of text, you need to add new lines manually using template literals or newline character syntax \n. For an example of both options, see the code examples.

Min: 1 character

Max: 450 characters

Was this helpful?