JSFiddle - React, Tailwind, and code Playground

HTML

<progress id="counter" max="100" value="0"></progress>
<button onclick="add()">
add + 10
</button>
<p id="counterText">
0
</p>

JavaScript

function add() {
	var counterMax = document.getElementById('counter').max;
	var counterVal = document.getElementById('counter').value;
  var counterText = document.getElementById('counterText');
  
	var counterAdd = document.getElementById('counter').value = counterVal + 10;
  counterText.innerHTML = counterAdd;
  
  if(counterVal > counterMax) {
  	var counterTotal = document.getElementById('counter').value = counterAdd - counterMax;
    counterText.innerHTML = counterToTal
  }
}