Generating RandomNumbers

Sandhyab
Posted by Sandhyab under JavaScript category on | Points: 40 | Views : 905
<body onload="Load()">
<label id="lbl2"></label>
<label style="background-color:#b8b8ff; width: 10px;"; id="lbl1"></label>
</body>


Javascript:
<script type="text/javascript" language="javscript">
function Load() {
a=document.getElementById("lbl1").innerHTML = Math.floor(Math.random() * 10000);
document.getElementById("lbl2").innerHTML = Math.floor(Math.random() * 100000);
b = Math.floor(Math.random() * 11);
document.getElementById("img1").src = "images/"+ b + ".jpg";
}
</script>

Comments or Responses

Login to post response