Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

HTMLProgressElement: task progress with max and value

HTMLProgressElement exposes the max and value properties of a progress element. They describe the total amount of work and the completed portion, while distinguishing known zero progress from a state where the completion level is unknown.

Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support

Syntax

progress.max = total;
progress.value = completed;
progress.position;
progress.removeAttribute("value");

HTMLProgressElement is the DOM interface for the progress element, which presents task completion. Progress max/value covers two numeric properties: max describes the total amount of work, and value describes the completed portion. This is a browser Web API, not a feature of a particular ECMAScript edition; having Node 24 alone does not establish its availability.

max must be greater than 0 and defaults to 1. value represents progress from 0 to max, so it does not necessarily represent a percentage. With max = 8 and value = 3, three of eight units are complete. The minimum is always 0; the progress element does not support a min attribute.

When the value attribute is present, progress is determinate. The read-only position property then returns value / max. An absent value attribute means indeterminate progress: reading value returns 0, but position returns -1. Assigning value = 0 means known zero progress, not an indeterminate state. Use removeAttribute("value") to return to that state.

Provide an accessible name using an associated label element, aria-label, or aria-labelledby; text inside the element does not replace a label. MDN classifies the interface as widely available across browsers since July 2015. The example creates a detached element and demonstrates known zero versus unknown progress without animation or timing dependencies.

Examples

(() => {
  const progress = document.createElement("progress");
  progress.setAttribute("aria-label", "Task progress");
  progress.max = 8;
  progress.value = 3;
  console.log(`max=${progress.max}, value=${progress.value}, position=${progress.position}`);

  progress.value = 0;
  console.log(`zero: value=${progress.value}, position=${progress.position}`);

  progress.removeAttribute("value");
  console.log(`unknown: value=${progress.value}, position=${progress.position}`);
})();

Result

max=8, value=3, position=0.375
zero: value=0, position=0
unknown: value=0, position=-1

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources