entListener('click', () => {
      if (timer) {
        window.clearInterval(timer);
      }
      timer = window.setInterval(() => {
        if (prog.value >= 100) {
          prog.value = 0;
        } else {
          prog.value = prog.value + 1;
        }
      }, 100);
    });
    document.getElementById('btnr').addEventListener('click', () => {
      if (timer) {
        window.clearInterval(timer);
        timer = 0;
      }
      prog.value = 0;
    });
  </script>
</body>

</html>