Using the JavaScript for Loop : For Loop : Statement JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Statement » For Loop »

 

Using the JavaScript for Loop

















<HTML>
<HEAD>
<TITLE>
Using the JavaScript for Loop
</TITLE>
</HEAD>

<BODY>
<H1>Using the JavaScript for Loop</H1>
<SCRIPT LANGUAGE="JavaScript">
<!--
var i, total
total = 0
for (i = 1; i < 5; i++) {
   total += i
   document.write("Loop iteration " + i + " (Cumulative total = "  + total + ")<BR>")
}
// -->
</SCRIPT>
</BODY>
</HTML>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Statement
» For Loop