A While Loop That Decrements from 10 to 1 : While « Language Basics « JavaScript DHTML






A While Loop That Decrements from 10 to 1

  
<HTML>
<BODY>
<H1>
<SCRIPT> 
      var counter = 10; 
      while (counter > 0) 
      { 
         document.write (counter + "<br>"); 
         counter--; 
      } 
   </SCRIPT>
</H1>
</BODY>
</HTML>
           
         
    
  








Related examples in the same category

1.Using a Do/While Loop to Reverse a Text String
2.While loop
3.Do while loop
4.Using the while Loop in JavaScript
5.The do..while Statement Ensures at Least One Iteration
6.The while Statement
7.Loop in while
8.While loop test
9.Check the loop counter for while loop
10.Do ... while loop and output calculation result