Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 892471 of <progress>

  • Revision slug: Web/HTML/Element/progress
  • Revision title: <progress>
  • Revision id: 892471
  • Created:
  • Creator: jwhitlock
  • Is current revision? No
  • Comment Standardize footnotes to fix importer issue

Revision Content

{{ HTMLVersionHeader(5) }}

Summary

The HTML <progress> Element is used to view the completion progress of a task. While the specifics of how it's displayed is left up to the browser developer, it's typically displayed as a progress bar. Javascript can be used to manipulate the value of progress bar.

Attributes

This element includes the global attributes.

{{ htmlattrdef("max") }}
This attribute describes how much work the task indicated by the progress element requires. The max attribute, if present, must have a value greater than zero and be a valid floating point number.
{{ htmlattrdef("value") }}
This attribute specifies how much of the task that has been completed. It must be a valid floating point number between 0 and max, or between 0 and 1 if max is omitted. If there is no value attribute, the progress bar is indeterminate; this indicates that an activity is ongoing with no indication of how long it is expected to take.

You can use the {{ cssxref("-moz-orient") }} property to specify whether the progress bar should be rendered horizontally (the default) or vertically. The {{ cssxref(":indeterminate") }} pseudo-class can be used to match against indeterminate progress bars.

Examples

<progress value="70" max="100">70 %</progress>

Result

{{ EmbedLiveSample("Examples", 200, 50) }}

On Mac OS X, the resulting progress looks like this:

The progress bar seen in OS X Mavericks

On Windows, the resulting progress looks like this:

progress-firefox.JPG

Additional examples

See {{ cssxref("-moz-orient") }}.

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', 'the-button-element.html#the-progress-element', '<progress>')}} {{Spec2('HTML WHATWG')}}  
{{SpecName('HTML5 W3C', 'forms.html#the-progress-element', '<progress>')}} {{Spec2('HTML5 W3C')}} Initial definition

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 6.0 {{ CompatGeckoMobile("6.0") }} [1]
{{ CompatGeckoMobile("14.0")}} [2]
10 11.0 5.2
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatVersionUnknown }} {{ CompatGeckoMobile("6.0") }} [1]
{{ CompatGeckoMobile("14.0")}} [2]
{{ CompatNo() }} 11.0 7 [3]

[1] Gecko provides the {{ cssxref("::-moz-progress-bar") }} pseudo-element, which lets you style the part of the interior of the progress bar representing the amount of work completed so far.
Prior to Gecko 14.0 {{ geckoRelease("14.0") }}, the <progress> element was incorrectly classified as a form element, and therefore had a form attribute. This has been fixed.

[2] Gecko provides the {{ cssxref("::-moz-progress-bar") }} pseudo-element, which lets you style the part of the interior of the progress bar representing the amount of work completed so far.

[3] Safari on iOS does not support indeterminate progress bars (they are rendered like 0%-completed progress bars).

See also

{{ HTMLRef }}

Revision Source

<div>{{ HTMLVersionHeader(5) }}</div>

<h2 id="Summary">Summary</h2>

<p>The <strong>HTML<em> </em><code>&lt;progress&gt;</code> Element</strong> is used to view the completion progress of a task. While the specifics of how it's displayed is left up to the browser developer, it's typically displayed as a progress bar. Javascript can be used to manipulate the value of progress bar.</p>

<ul class="htmlelt">
 <li><dfn><a href="/en-US/docs/Web/HTML/Content_categories" title="HTML/Content_categories">Content categories</a></dfn> <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">Flow content</a>, <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content" title="HTML/Content categories#Phrasing content">phrasing content</a>, labelable content, palpable content.</li>
 <li><dfn>Permitted content</dfn> <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">Phrasing content</a>, but there must be no <code>&lt;progress&gt;</code> element among its descendants.</li>
 <li><dfn>Tag omission</dfn> {{no_tag_omission}}</li>
 <li><dfn>Permitted parent elements</dfn> Any element that accepts <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">phrasing content</a>.</li>
 <li><dfn>DOM interface</dfn> {{domxref("HTMLProgressElement")}}</li>
</ul>

<h2 id="Attributes">Attributes</h2>

<p><span style="line-height:21px">This element includes the&nbsp;</span><a href="/en-US/docs/Web/HTML/Global_attributes" style="line-height: 21px;" title="HTML/Global attributes">global attributes</a><span style="line-height:21px">.</span></p>

<dl>
 <dt>{{ htmlattrdef("max") }}</dt>
 <dd>This attribute describes how much work the task indicated by the <code>progress</code> element requires. The <code>max</code> attribute, if present, must have a value greater than zero and be a valid floating point number.</dd>
 <dt>{{ htmlattrdef("value") }}</dt>
 <dd>This attribute specifies how much of the task that has been completed. It must be a valid floating point number between 0 and <code>max</code>, or between 0 and 1 if <code>max</code> is omitted. If there is no <code>value</code> attribute, the progress bar is indeterminate; this indicates that an activity is ongoing with no indication of how long it is expected to take.</dd>
</dl>

<p>You can use the {{ cssxref("-moz-orient") }} property to specify whether the progress bar should be rendered horizontally (the default) or vertically. The {{ cssxref(":indeterminate") }} pseudo-class can be used to match against indeterminate progress bars.</p>

<dl>
</dl>

<h2 id="Examples">Examples</h2>

<pre class="brush: html">
&lt;progress value="70" max="100"&gt;70 %&lt;/progress&gt;
</pre>

<h3 id="Result">Result</h3>

<p>{{ EmbedLiveSample("Examples", 200, 50) }}</p>

<p>On Mac OS X, the resulting progress looks like this:</p>

<p><img alt="The progress bar seen in OS X Mavericks" class="default internal" src="https://mdn.mozillademos.org/files/6863/Screenshot%202014-01-30%2011.14.30.png" style="height:24px; width:167px" /></p>

<p>On Windows, the resulting progress looks like this:</p>

<p><img alt="progress-firefox.JPG" class="default internal" src="/@api/deki/files/6031/=progress-firefox.JPG" /></p>

<h3 id="Additional_examples">Additional examples</h3>

<p>See {{ cssxref("-moz-orient") }}.</p>

<h2 id="Specifications" name="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'the-button-element.html#the-progress-element', '&lt;progress&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>&nbsp;</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'forms.html#the-progress-element', '&lt;progress&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{ CompatibilityTable() }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>6.0</td>
   <td>{{ CompatGeckoMobile("6.0") }} [1]<br/>
       {{ CompatGeckoMobile("14.0")}} [2]<br/>
   </td>
   <td>10</td>
   <td>11.0</td>
   <td>5.2</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatVersionUnknown }}</td>
   <td>{{ CompatGeckoMobile("6.0") }} [1]<br/>
       {{ CompatGeckoMobile("14.0")}} [2]<br/>
   </td>
   <td>{{ CompatNo() }}</td>
   <td>11.0</td>
   <td>7 [3]</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] Gecko provides the {{ cssxref("::-moz-progress-bar") }} pseudo-element, which lets you style the part of the interior of the progress bar representing the amount of work completed so far.
<br/>
Prior to Gecko 14.0 {{ geckoRelease("14.0") }}, the <code>&lt;progress&gt;</code> element was incorrectly classified as a form element, and therefore had a <code>form</code> attribute. This has been fixed.
</p>

<p>[2] Gecko provides the {{ cssxref("::-moz-progress-bar") }} pseudo-element, which lets you style the part of the interior of the progress bar representing the amount of work completed so far.
</p>

<p>[3] Safari on iOS does not support indeterminate progress bars (they are rendered like 0%-completed progress bars).</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{ cssxref("-moz-orient") }}</li>
 <li>{{ cssxref(":indeterminate") }}</li>
 <li><a href="https://www.tutorialspark.com/HTML5Reference/HTML5_progress_Tag.php" title="https://www.tutorialspark.com/HTML5_Tags_Reference/HTML5_progress_Tag.php">HTML5 Progress Element</a></li>
</ul>

<p>{{ HTMLRef }}</p>
Revert to this revision