Generate One Digit Random Number in JavaScript
<!DOCTYPE html> <html> <head> <script type="text/javascript"> var num = Math.floor(Math.random() * 10 + 1); document.writeln(num); </script> </head> <body> </body> </html>
<!DOCTYPE html> <html> <head> <script type="text/javascript"> var num = Math.floor(Math.random() * 10 + 1); document.writeln(num); </script> </head> <body> </body> </html>