Untitled
2 years ago by ezejohnson763 in HTML
<!DOCTYPE html>
<html>
<body>
<div align="center">
<p>Click Generate Button to generate a random number between 1 and 100.</p>
<button onclick="myFunction()">Generate</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("demo")
x.innerHTML = Math.floor((Math.random() * 100) + 1);
}
</script>
</div>
</body>
</html>