JSFiddle - React, Tailwind, and code Playground

HTML

<div id="Timer5min">

300
</div>

JavaScript

var sec = $('#Timer5min').text()
var timer = setInterval(function() { 
   $('#Timer5min').text(--sec);
   if (sec == 0) {
     //redirect
      clearInterval(timer);
   } 
}, 1000);