Javascript to generate a 5-digit fixed length random number ???

Javascript to generate a 5-digit fixed length random number ???

Hi,

I'm using K2 Smartforms, where you can embed Jquery/javascript in data labels using expressions.

Can anyone help me create some jquery/javascript which can generate a RANDOM number which is of a fixed length of 5 i.e between 10000 and 99999

Thanks,

I tried this code which I found to work ok with the data label, but this generates random number continually, is there any way to modify it to work as I want?

< span id="number"></span>

< script language="javascript">
function generate() {
$('#number').text(Math.floor(Math.random() * 6) + 1);
}
setInterval(generate, 1000);
< /script>


thanks