<html>
<body>
<script type="text/javascript">
var i = 0
for ( i=0; i<=10; i++)
{
document.write( i+"<br/>"); // the + is "and do this task too"
}
</script>
</body>
</html>
"While" Loop
<html>
<body>
<script type="text/javascript">
var i=0;
while ( i<=10)
{
document.write ( "Here is the number" +i);
document.write ("<br/>");
i=i+1;
}
</script>
</body>
</html>
The Javascript Break (eg. Show only the top 10 list)
<html>
<body>
<script type="text/javascript">
var i = 0
for ( i=0; i<=10; i++)
{
if (i = = 5 )
{
break;
}
document.write ("Here is the number " +1);
document.write ("<br/>");
}
</script>
</body>
</html>
The Javascript Continue (eg.skip only number 5 and continue the rest)
<html>
<body>
<script type="text/javascript">
var i = 0
for ( i=0; i<=10; i++)
{
if (i = = 5 )
{
continue;
}
document.write ("Here is the number " +1);
document.write ("<br/>");
}
</script>
</body>
</html>