I can't get the following code to work on the frontend. It displays correctly but will not countdown as I would like. I have tried changing the date but nothing happens. Could someone point me in the right direction? Thanks
<p>
<script type="text/javascript">
// <![CDATA[
var end = new Date("06/22/2016 ");
var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour * 24;
var timer;
function showRemaining() {
var end = new Date("06/22/2016");
var now = new Date();
var distance = end - now;
var days = Math.floor(distance / _day);
var hours = Math.floor((distance % _day) / _hour);
var minutes = Math.floor((distance % _hour) / _minute);
var seconds = Math.floor((distance % _minute) / _second);
document.getElementById('coupon_days').innerHTML = '<span>'+days+'D </span>';
document.getElementById('coupon_hours').innerHTML = '<span>'+hours+'H </span>';
document.getElementById('coupon_minutes').innerHTML = '<span>'+minutes+'M </span>';
document.getElementById('coupon_seconds').innerHTML = '<span>'+seconds+'S </span>';
}
timer = setInterval(showRemaining, 1000);
// ]]>
</script>
</p>
<div class="order_line_content">
<p>Order Before <strong><span style="color: #ff99cc;">1D-<span id="coupon_hours">1H-</span><span id="coupon_minutes">40M-</span></span></strong><span id="coupon_seconds"><span><strong><span style="color: #ff99cc;">2S</span></strong> </span></span><span id="coupon_seconds">to go</span> To Get Upto 20% off.</p>
</div>