October 20, 200818 yr Hey ! I have this piece of code, which is a countdown : <span id="countdown"></span> <script type="text/javascript"> var start = 6; Number.prototype.toMinutesAndSeconds = function() { var nbr = Math.floor(this / 60); return (nbr+"")+(((nbr=(this-(nbr*60)))<10)?""+nbr:nbr); } function display(seconds, output) { output.innerHTML = (--seconds).toMinutesAndSeconds(); if(seconds > 0) { window.setTimeout(function(){display(seconds, output)}, 1000); } if(seconds < 11) { document.getElementById("notifier").innerHTML = ""; } if (seconds == 0) { document.getElementById("notifier").innerHTML = ""; } } display(start, document.getElementById("countdown")); </script> What I want to do is remove the leading zero on the countdown. How do I do that ? Thanks. Revs.
Create an account or sign in to comment