Looping JavaScript for loop in JavaScript uses the number of times specified to execute the same code block or the specified condition is true.
Example
For loop
How to write a loop. The number of times that the same code block is run by the closed loop used.
<body>
<script type= "Text/javascript" >
for (i = 0; I <= 5; i++)
{
document.write (http://www.111cn.net + i);
document.write ("<br/>");
}
</script>
</body>
HTML title by looping
How to use the loop loop through different HTML headings.
<script type= "Text/javascript" >
for (i = 1; I <= 6; i++)
{
document.write ("document.write ("}
</script>
The looping of JavaScript
Often when you write code, you want the same piece of code to run over and over again in a row. Instead of adding almost equal line scripts, we can use loops to perform such tasks.
There are two different types of loops in javascript:
is the number of times specified by the loop through the code block.
And-Loop through the code block, while the specified condition is real
For loop
The For loop is used when you know in advance how many times the script should run.
Grammar
for (var=startvalue;var<=endvalue;var=var+increment)
{
www.111cn.net/wy/yw.html
}