Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h2>JavaScript Math</h2> <p>Math.floor(Math.random() * 10) returns a random integer between 0 and 9 (both included):</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = Math.floor(Math.random() * 10); </script> </body> </html>