The while Statement : While « Language Basics « JavaScript DHTML
- JavaScript DHTML
- Language Basics
- While
The while Statement
<HTML>
<HEAD>
<TITLE>Using the While Statement</TITLE>
</HEAD>
<BODY>
<SCRIPT><!--
i=1
while(i<7){
document.write("<H"+i+">This is a level "+i+" heading." +"</H"+i+">")
++i
}
// --></SCRIPT>
</BODY>
</HTML>
Related examples in the same category