Baseline Widely available
The value
property of the HTMLProgressElement
interface represents the current progress of the <progress>
element.
A floating point number. If max
value is not set on the progress bar then value ranges between 0.0 and 1.0. If the max
value is set then the value
ranges between 0
and the max
value.
If the value
property is not set on HTMLProgressElement
object, then the progress bar remains indeterminate.
Determinate Progress bar: <progress id="pBar"></progress> <span>0</span>%
<br />
Indeterminate Progress bar: <progress></progress>
JavaScript
const pBar = document.getElementById("pBar");
const span = document.getElementsByTagName("span")[0];
pBar.max = 100;
pBar.value = 0;
setInterval(() => {
pBar.value = pBar.value < pBar.max ? pBar.value + 1 : 0;
span.textContent = Math.trunc(pBar.position * 100);
}, 100);
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4