Progress value Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Progress

Description

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

Return Value

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:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials