Publish in HTML Tutorial el 25/05/2025 15:11
The
<progress>
element in HTML is used to represent the completion progress of a task. It provides a visual indication of how much of a task has been completed, typically displayed as a horizontal bar that fills up as the progress increases. This element is commonly used in web applications to show loading status, file uploads, or any process with measurable progress.
The
<progress>
element supports two main attributes:
To use the
<progress>
element, simply define the value and optionally the max attribute:
This will render a progress bar filled to 70% of its total width. Browsers that do not support the
<progress>
element will display the fallback text inside the tag (e.g., "70%").
This example shows a basic progress bar that does not change over time.
If you don't know the exact progress, you can omit the
value
attribute to create an indeterminate progress bar (often shown as a moving animation).
In this example, we use JavaScript to update the progress bar's value every second until it reaches 100%.
This example allows users to click a button to increase the progress by 10% each time.
This example dynamically creates 5 progress bars and updates them simultaneously using JavaScript.
max
attribute to scale your progress values accordingly (e.g., for file uploads, set max="100" for percentage-based progress).
<progress>
tag for browsers that don't support it.
<progress>
element using CSS, but note that styling may vary across browsers due to default user agent styles.
<progress>
element for representing static data like statistics; use a custom bar chart instead.
The <style> HTML element contains style information for a document, or part of a document. ...
The <strong> element is used to indicate that its content has strong importance, seriousnes...
The <span> element is an inline container used to mark up a part of a text or document. Unl...
The <source> element is used to specify multiple media resources for media elements like &l...
The <small> element is used to represent side-comments and small print, typically for discl...
HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...