When you use this method it will give you a pseudo-random number between 0 (inclusive) and 1 (exculsive).
Math.random();
function randomexample() { document.getElementById("random").innerHTML = Math.random(); }