So I have this code:
initialize: function() {
setInterval(function() {
min = parseInt($('#js-clock').text()) - 1;
$('#js-clock').text(min + 'm');
if (min == 0){
// Do Something
}
}, 1000);
}
Which goes through and replaces the following div:
<div class="col-xs-8 text-large js-beacon-clock" id="js-clock">
<i class="fa fa-clock-o"></i>30m
</div>
with
<div class="col-xs-8 text-large js-beacon-clock" id="js-clock">
29m
</div>
I don't want to have to append the <i>
tag in the JavaScript, that should remain separate. So how do I change the minutes with out losing everything in the inner div just to change 30 to 29?