JSFiddle - React, Tailwind, and code Playground
by doug65536
HTML
<span id="logout-countdown"></span>
JavaScript
app = { config: { userActionTimeout: 20 } };
var timerTotal = app.config.userActionTimeout,
countDownTimer = setInterval(function () {
timerTotal--;
$('#logout-countdown').text(timerTotal);
if (timerTotal <= 0) {
clearInterval(countDownTimer);
}
}, 1000);