Javascript examples for DOM HTML Element:Progress
The value property sets or gets the value attribute of a progress bar.
Set the value property with the following Values
Value | Description |
---|---|
number | Sets how much of the task has been completed |
A floating point number, representing the current progress of the task
The following code shows how to change the current value in a progress bar:
<!DOCTYPE html> <html> <body> Downloading progress:// w w 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").value = 100; document.getElementById("demo").innerHTML = 'changed'; } </script> </body> </html>