Loops
JavaScript CODE:
<Script>
for(x=1;x<=10;x++){
document.write("The value of x is--->"+x+"<BR>");
}
</Script>
OUTPUT:
*********************************************** END OF SAMPLE #1
Populate a Table with a Loop
JavaScript CODE:
<script language="JavaScript">
<!-- Hide from non-JavaScript browsers
document.write("<table border=1><TR>");
for(x=1;x<=10;x++){
document.write("<TD>x is "+x+"<P></TD>");
}
document.write("</TR><TR>");
for(x=11;x<=20;x++){
document.write("<TD>x is "+x+"<P></TD>");
}
document.write("</TR></table>");
//stop hiding-->
</script>
OUTPUT:
*********************************************** END OF SAMPLE #2