jkkenzie Posted January 26, 2010 Share Posted January 26, 2010 I need javascript to generate value like below and the the ability to place it on a forms input value like below php code. <?php $mynumber= rand(673,62389); echo $mynumber; ?> <input type="text" value="<?=$mynumber?>"> Thanks Quote Link to comment Share on other sites More sharing options...
salathe Posted January 26, 2010 Share Posted January 26, 2010 Look into using Math.random (and basic arithmetic operators as well as likely Math.floor) for generating a random number and the DOM for changing attributes (particularly the setAttribute method on DOM Elements). Hopefully that's enough keywords to search on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.