For loop for lines : For : Language Basics : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP
JavaScript DHTML Home »  Language Basics   » [  For  ]   
 



For loop for lines

Please note that some example is only working under IE or Firefox.

/*
Javascript Essentials
by Jason J. Manger

Publisher: Mcgraw-Hill Osborne Media; 

ISBN: 0078822343
*/

<!-- 
  Program 3-1
-->
<html>
<head>
<script language="JavaScript">
<!--
function testLoop() {
  var String1 = '<hr align="center" width=';
  document.open();
  for (var size = 5; size <= 100; size+=5)
      document.writeln(String1 + size + '%">');
  document.close();
}
//-->
</script>
</head>
<body>
<form>
<input type="button" 
       value="Test the loop"
       onClick="testLoop()">
</form>
</body>
</html>


           
       
Related examples in the same category
1.   Drawing a Christmas Tree Using Nested For Loops
2.  For loop
3.  Using a for..in Loop in JavaScript
4.  A Demonstration of a Nested Loop
5.  A for Loop Used to Count from 0 to 99
6.  Using the label Statement
7.  Using the continue and break Statements
8.  Use of the for Statement
9.  The break Statement
10.  The continue Statement
11.  Labeled Statements
12.  Plain for loop
13.  For loop with alert dialog
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.