Skip to content
The HTML Herbarium

/static/herbario/disruptivo/en/especime/output/

Menu

HTM-025 · Forms

<output>

The result of a calculation made from the other fields.

It is a live region by default: changes to its content are announced by screen readers without needing aria-live. The for attribute lists the ids of the fields that went into the sum, declaring the dependency in the HTML itself.

It needs script to calculate, but the element is what announces the result.

<form>
  <input type="range" id="coletados" name="coletados" value="12" max="30">
  of 30 specimens
  <output for="coletados" name="restam">18 left</output>
</form>
{esc(legenda)}
12 collected · 18 left
Living specimen · the initial value is HTML; recalculating is the only part that needs script