<t-out>
Shows the live result of an expression in the text.
Splitting a
Attributes
| Attribute | Default | Description |
|---|---|---|
expr | The expression to show. | |
name | Shorthand for showing a single variable: <t-out name="total"> is <t-out expr="total">. | |
format | automatic | How 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
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: