Random number from 0 to 10: a random number from 0 to 10 using the random() and round() : Random « Language Basics « JavaScript DHTML






Random number from 0 to 10: a random number from 0 to 10 using the random() and round()

  
<html>
<body>

<script type="text/javascript">

    no=Math.random()*10
    document.write(Math.round(no))
    
</script>

</body>
</html>



           
         
    
  








Related examples in the same category

1.Unique Random Numbers
2.Unique Random Sets
3.Math Random number: a random number between 0 and 1
4.Random link
5.A Random Ad Display Page
6.Random URL
7.Find the random number in a range