Javascript DOM HTML Progress value Property set

Introduction

Change the current value in a progress bar:

document.getElementById("myProgress").value = "75";

Click the button to change the value attribute of the progress bar to "75".

View in separate window

<!DOCTYPE html>
<html>
<body>

Downloading progress:/*from  ww  w . j  a v  a  2  s  .c  om*/
<progress id="myProgress" value="22" max="100">
</progress>
<button onclick="myFunction()">Test</button>

<script>
function myFunction() {
  document.getElementById("myProgress").value = "75";
}
</script>

</body>
</html>

The value property sets or gets the value attribute of a progress bar.

The value attribute sets how much of the task has been completed.

The value property accepts and returns a number type value.




PreviousNext

Related