Sunday, January 12, 2014

JavaScript While loop example.

<html>
<body>
<script>
var i=1;
function mahi()
{
while(i<=10)
{
document.write(i+"<br>");
i++;
}
}
</script>
<form>
<input type="button" value="While Loop" onclick="mahi()"/>
</form>
</body>
</html>

No comments:

Post a Comment