Javascript DOM HTML Progress max Property set

Introduction

Change the maximum value in a progress bar:

document.getElementById("myProgress").max = "50";

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

View in separate window

<!DOCTYPE html>
<html>
<body>

Downloading progress://w w w.  ja  v  a 2s  . c  o m
<progress id="myProgress" value="22" max="100">
</progress>
<button onclick="myFunction()">Test</button>

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

</body>
</html>

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

The max attribute sets the value considered complete.

The max property accepts and returns a number type value.




PreviousNext

Related