<script type="text/javascript"> function sum () { var sum=0 for ( var i=1; i<=100; i++) { sum+=i; } document.write ("1+2+....+100="+sum); } </script>