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 |
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:
<!DOCTYPE html> <html> <body> Downloading progress:/*from ww w.j a va 2 s .c o m*/ <progress id="myProgress" value="22" max="100"> </progress> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myProgress").max = 200; document.getElementById("demo").innerHTML = 'changed'; } </script> </body> </html>