کد HTML:
<html> <body> <script type= "text/javascript" > document.write(" <h3> ");var i = 0;var result = 0;var status=true;document.write("0");while(status){ i++; document.write(" + " + i); result += i; if(i==10) status=false; }//end of whiledocument.write(" = " + result); </script> </body> </html>