I am getting an output of 00 min NaN sec. Does anyone know what may be wrong with my code?
Desired outcome, countdown from 5min then add class 'ended'
using jquery.countdown.js
Thank you.
$(function() {
var endDate = "05:00";
$('.countdown.callback').countdown({
date: endDate,
render: function(data) {
$(this.el).html("<div>" + this.leadingZeros(data.min, 2) + " <span>min</span></div><div>" + this.leadingZeros(data.sec, 2) + " <span>sec</span></div>");
},
onEnd: function() {
$(this.el).addClass('ended');
}
}).on("click", function() {
$(this).removeClass('ended').data('countdown').update(endDate).start();
});
});