<t-out>

Shows the live result of an expression in the text.

Splitting a bill 3 ways with a 15% tip comes to $32.20 each.

Attributes

AttributeDefaultDescription
exprThe expression to show.
nameShorthand for showing a single variable: <t-out name="total"> is <t-out expr="total">.
formatautomaticHow to display the result. See formats.

The element's text is replaced as soon as the script runs, so it makes a good fallback for readers without JavaScript (the $32.20 above).

Text results

Expressions can return strings, which makes <t-out> the tool for words that change with the numbers:

You have 1

Errors

If the expression throws, the element shows ⚠ in the error color, and its tooltip holds the message. Hover over this one:

This output is broken: