Progress max Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Progress


The max property sets or gets the max attribute of a progress bar, which is the value in finished state.

Set the max property with the following Values

Value Description
number Sets how much work the task requires in total before it can be considered complete

Return Value

A floating point number, representing how much work the task requires in total

The following code shows how to change the maximum value in a progress bar:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

Downloading progress:/*from ww  w.j a va 2  s  .c o m*/
<progress id="myProgress" value="22" max="100">

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {
    document.getElementById("myProgress").max = 200;
    document.getElementById("demo").innerHTML = 'changed';


Related Tutorials