HTML <progress> hidden Attribute

The hidden attribute on a <progress> tag hides the progress element. Althought the progress element is not visible, its position on the page is maintained.

Example

#

A hidden attribute on a <progress> tag.
The progress control is not visible.

A hidden progress element:

<p>A hidden progress element:</p>

<progress value="50" max="100" hidden> 50% </progress>

Using hidden

The hidden attribute hides the <progress> element.

You can specify either 'hidden' (without value) or 'hidden="hidden"'. Both are valid.

A hidden <progress> element is not visible, but it maintains its position on the page.

Removing the hidden attribute makes it re-appear.


Syntax

<progress hidden>
or
<progress hidden="hidden">

Values

#

Value Description
hidden Use 'hidden' or hidden='hidden'. Both are valid.

More Examples

Clicking the button toggles the hidden attribute on the <progress> element.

Loading files...

40%
<div>Loading files... </div>

<br />
<progress id="myprogress" value="40" max="100"> 40% </progress>

<br />
<button onclick="toggle(this)">Hide progress</button>

<script>
  let toggle = button => {
    let element = document.getElementById("myprogress");
    let hidden = element.getAttribute("hidden");
    
    if (hidden) {
       element.removeAttribute("hidden");
       button.innerText = "Hide progress";
    } else {
       element.setAttribute("hidden", "hidden");
       button.innerText = "Show progress";
    }
  }
</script>

Code explanation

Initially, the <progress> control is visible.

Clicking the button calls JavaScript which toggles the hidden attribute.

With the hidden attribute the progress control is invisible.


Browser support

Here is when hidden support started for each browser:

Chrome
8.0 Dec 2010
Firefox
16.0 Oct 2012
IE/Edge
10.0 Sep 2012
Opera
11.0 Dec 2010
Safari
6.0 Jul 2012

You may also like

 Back to <progress>
Guides