Possible Duplicate:
How to output integers with leading zeros in JavaScript
I have a function increment, it increments value by 1 on mouse click. But i want it to increment from 00001 to 00002 on mouse click and 00003 etc so on...on each mouse click.
<script type="text/javascript">
$(document).ready(function(){
var count = 00001;
$('#increment').click(function (e) {
e.preventDefault();
count++;
$('p').text(count);
});
});
</script>
<p>00001</p>
<input type="button" value="Increment" id="increment"/>
Help me please,
Thanks,