HTML - <progress> Tag



HTML <progress> tag is used to display as an indicator showing the completion progress of a task, commonly displayed as a progress bar. This is a new tag included in HTML5. It used as a progress indicator.

Syntax

<progress>.....</progress>

Attribute

HTML progress tag supports Global and Event attributes of HTML. Some specific attributes as well which are listed bellow.

HTML progress Tag Attributes

Attribute Value Description
value number Hold a number that defines the current value of the progress bar.
max number This is used to set the maximum value of the progress bar.

Examples of HTML progress Tag

In the following examples we will see the use cases, where and how to use the HTML progress tag to represent progress status.

Specifying the Progress Bar

In the following example, let’s see the usage of the <progress> tag and how it will show a progress bar.

<!DOCTYPE html>
<html>
<body>
   <h1>HTML Progress Bar</h1>
   <label for="task">Work completed:</label>
   <progress id="task" value="35" max="100"> 35% </progress>
</body>
</html>

Download completion using progress Tag

Considering the following example, we are using the <progress> tag and displaying how much a file has been downloaded.

<!DOCTYPE html>
<html>
<body>
   <h1>HTML Progress Bar</h1>
   <label for="file">Downloading progress:</label>
   <progress id="file" value="45" max="100"> 45% </progress>
</body>
</html>

Invalid Progress bar with no Attribute

Let's look at the following example, where we use the <progress> tag without any attributes. If no attributes are specified in the progress tag, the progress bar will travel left-to-right and right-to-left.

<!DOCTYPE html>
<html>
<body>
   <h1>HTML Progress Bar</h1>
   <progress></progress>
</body>
</html>

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
progress Yes 8.0 Yes 10.0 Yes 16.0 Yes 6.0 Yes 11.0
html_tags_reference.htm
Advertisements