Random() to return a random number between 0 and 10
<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button</p>
<button onclick="myNum()">Get New Number</button>
<script>
function myNum()
{
document.write(Math.floor(Math.random()*10));
}
</script>
</body>
</html>