Check the loop counter
<html> <head> <title></title> </head> <body> <script type="text/javascript"> for (var i = 1; i < 101; i++) { if (i == 99) { alert("The number is " + i); } } </script> </body> </html>