I made a script that generates a number between 1 and a googol (which is a number consisting of a 1 and a hundred zeros), but it can't display the numbers proberly. It makes numbers like "7.463677302002907e+99" and that's not what I want. I'm very new to Javascript, but I managed to make this. Here's the code:
<html>
<body>
<title>Random number between 1 an a googol-generator</title>
<p id="demo">Click the button to display a random number between 1 and a googol.</p>
<button onclick="myFunction()">Generate</button>
<script>
function myFunction()
{
var x=document.getElementById("demo")
x.innerHTML=Math.floor((Math.random()*10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)+1);
}
</script>
</body>
</html>