<!----------Upload bar----------->

<link rel="canonical" href="https://www.cdn.getweb.dev/docs/v1/css/getweb.css">
<div class="gw-container">
  <h2>Dynamic Progress Bar with Labels</h2>
  <p>Label outside of the progress bar:</p>

  <div class="gw-light-grey">
    <div id="myPro" class="gw-container gw-green" style="height:24px;width:0%">
    </div>
  </div>

  <p id="myPro">Added <span id="Upload">0</span> of 10 photos</p>

  <button id="myPro" class="gw-button gw-light-grey" onclick="move();this.disabled='true'">Upload Photos</button> 
</div>





//-----------------Upload File progress bar

function move() {
  var elem = document.getElementById("myPro");   
  var width = 0;
  var id = setInterval(frame, 50);
  function frame() {
    if (width >= 100) {
      clearInterval(id);
      document.getElementById("myPro").className = "gw-text-green gw-animate-opacity";
      document.getElementById("myPro").innerHTML = "Successfully uploaded 10 photos!";
    } else {
      width++; 
      elem.style.width = width + '%'; 
      var num = width * 1 / 10;
      num = num.toFixed(0)
      document.getElementById("Upload").innerHTML = num;
    }
  }
}

External CSS

  1. https://www.cdn.getweb.dev/docs/v1/css/getweb.css

External JavaScript

This Pen doesn't use any external JavaScript resources.