var counter = 5;
var timer = setInterval(function () {
seconds--;
$('#regmsg').html('Successful! Message will close in ' + counter);
if (counter == 0) {
$.fancybox.close();
parent.location.reload();
}
}, 1000);
$.fancybox({
href: '#regmsg',
type: 'inline',
'closeBtn': false
});
I want the time to show in #regmsg but it is only showing ‘Successful!’ and not the rest of the message. What is the problem? How do I fix it?
Change
secondstocounter.demo