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>