Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <progress> hidden Attribute

A hidden attribute on a <progress> tag hides the progress element.

Although 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 A 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>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides