The following code generate the random number between 1 to 900
<html>
<head>
<title>Random number in javascript</title>
<script>
getRandom();
function getRandom() {
var random_no = Math.floor(Math.random() * 900) + 1;
alert(random_no);
}
</script>
</head>
<body>
<h1>Random number in Javascript!</h1>
</body>
</html>
No comments:
Post a Comment