What is the <progress> element in HTML?

In HTML, the <progress> element is used to display the completion progress of a task. <progress> shows an indicator typically displayed as a progress bar.

Syntax

<progress max="" value=""> progress percentage </progress>

Where:

  • max: Takes number as its value and specifies the maximum or total value required by the task. The default value is 1.
  • value: Takes floating point number as its value and specifies the amount of task that has been completed. It must be a valid number between 0 and max (1 if max is not defined).

If the value attribute is undefined, the progress bar is in an indeterminate state, which indicates an ongoing task without any expected completion time.

Example

The following code demonstrates the use of the <progress> element in HTML. The progress bar of content is written with both the opening and closing tags, <progress> and </progress>.

  • HTML

Free Resources