✔ 最佳答案
<html>
<head>
<title></title>
<script type="text/javascript">
function onload() {
var result = sumOfNumberBetween(2, 100);
document.getElementById("result").innerHTML = result;
return true;
}
function sumOfNumberBetween(min, max) {
var result = 0;
for (var i = min; i <= max; i += 2) {
result += i;
}
return result;
}
</script>
</head>
<body onload="onload()">
<div>
The sum of all even number between 1 and 100 is <span id="result" />.
</div>
</body>
</html>