<html> <body> <script type="text/javascript"> var total = 0; var k = 1; while(k <= 10) { total = total + k; k = k + 1; } alert("total = " + total); </script> </body> </html>