JSFiddle - React, Tailwind, and code Playground
HTML
<div id="progress" class="progress">
<div id="bar" class="bar"></div>
</div>
CSS
.progress {
border:1px solid #2e8b57;
height:20px;
width:200px
}
.bar {
width:0;
background-color: #add8e6;
height:100%
}
JavaScript
$(document).ready(function () {
setInterval((function(){
//var width = $(bar).innerWidth();
var width = ( 100 * parseFloat($('#bar').css('width')) / parseFloat($('#bar').parent().css('width')) ) ;
if (width < 90) {
var bar = (width + 10)+'%';
$('#bar').animate({'width': bar})
}
}),
1000);
});