x
 
1
<!DOCTYPE html>
2
<title>My Example</title>
3
4
5
<p id="msg"></p>
6
<p>The <code>Math.random()</code> function returns a floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive).</p>
7
8
<script>
9
  document.getElementById("msg").innerHTML = Math.random( 1, 100 );
10
</script>