_x000D_
var seconds_inputs = document.getElementsByClassName('deal_left_seconds');_x000D_
var total_timers = seconds_inputs.length;_x000D_
for ( var i = 0; i < total_timers; i++){_x000D_
var str_seconds = 'seconds_'; var str_seconds_prod_id = 'seconds_prod_id_';_x000D_
var seconds_prod_id = seconds_inputs[i].getAttribute('data-value');_x000D_
var cal_seconds = seconds_inputs[i].getAttribute('value');_x000D_
_x000D_
eval('var ' + str_seconds + seconds_prod_id + '= ' + cal_seconds + ';');_x000D_
eval('var ' + str_seconds_prod_id + seconds_prod_id + '= ' + seconds_prod_id + ';');_x000D_
}_x000D_
function timer() {_x000D_
for ( var i = 0; i < total_timers; i++) {_x000D_
var seconds_prod_id = seconds_inputs[i].getAttribute('data-value');_x000D_
_x000D_
var days = Math.floor(eval('seconds_'+seconds_prod_id) / 24 / 60 / 60);_x000D_
var hoursLeft = Math.floor((eval('seconds_'+seconds_prod_id)) - (days * 86400));_x000D_
var hours = Math.floor(hoursLeft / 3600);_x000D_
var minutesLeft = Math.floor((hoursLeft) - (hours * 3600));_x000D_
var minutes = Math.floor(minutesLeft / 60);_x000D_
var remainingSeconds = eval('seconds_'+seconds_prod_id) % 60;_x000D_
_x000D_
function pad(n) {_x000D_
return (n < 10 ? "0" + n : n);_x000D_
}_x000D_
document.getElementById('deal_days_' + seconds_prod_id).innerHTML = pad(days);_x000D_
document.getElementById('deal_hrs_' + seconds_prod_id).innerHTML = pad(hours);_x000D_
document.getElementById('deal_min_' + seconds_prod_id).innerHTML = pad(minutes);_x000D_
document.getElementById('deal_sec_' + seconds_prod_id).innerHTML = pad(remainingSeconds);_x000D_
_x000D_
if (eval('seconds_'+ seconds_prod_id) == 0) {_x000D_
clearInterval(countdownTimer);_x000D_
document.getElementById('deal_days_' + seconds_prod_id).innerHTML = document.getElementById('deal_hrs_' + seconds_prod_id).innerHTML = document.getElementById('deal_min_' + seconds_prod_id).innerHTML = document.getElementById('deal_sec_' + seconds_prod_id).innerHTML = pad(0);_x000D_
} else {_x000D_
var value = eval('seconds_'+seconds_prod_id);_x000D_
value--;_x000D_
eval('seconds_' + seconds_prod_id + '= ' + value + ';');_x000D_
}_x000D_
}_x000D_
}_x000D_
_x000D_
var countdownTimer = setInterval('timer()', 1000);
_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>_x000D_
<input type="hidden" class="deal_left_seconds" data-value="1" value="10">_x000D_
<div class="box-wrapper">_x000D_
<div class="date box"> <span class="key" id="deal_days_1">00</span> <span class="value">DAYS</span> </div>_x000D_
</div>_x000D_
<div class="box-wrapper">_x000D_
<div class="hour box"> <span class="key" id="deal_hrs_1">00</span> <span class="value">HRS</span> </div>_x000D_
</div>_x000D_
<div class="box-wrapper">_x000D_
<div class="minutes box"> <span class="key" id="deal_min_1">00</span> <span class="value">MINS</span> </div>_x000D_
</div>_x000D_
<div class="box-wrapper hidden-md">_x000D_
<div class="seconds box"> <span class="key" id="deal_sec_1">00</span> <span class="value">SEC</span> </div>_x000D_
</div>
_x000D_