Check the loop counter for while loop : While « Language Basics « JavaScript DHTML
- JavaScript DHTML
- Language Basics
- While
Check the loop counter for while loop
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
var i = 1;
while (i < 101) {
if (i == 99) {
alert("The number is " + i);
}
i++;
}
</script>
</body>
</html>
Related examples in the same category