我试图让函数“RipIt”(不是我的名字)获取这个杜威十进制数列表,如果满足某些条件(例如,100 到 200 之间的所有数字,加 100,如第一个else if 语句)并在单击按钮时返回答案,以及说明已更改的文本通知或警报。我是一个完全的初学者,我被困在最后一部分 - 使函数加法或减法并给我答案。任何人都可以帮忙吗?初学者所以请温柔,谢谢!
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function RipIt() {
for(var i = l; i <= 25; i++) {
var dewey = parseFloat(document.getElementById(i).innerHTML);
if(dewey >= 100 && 200 >= dewey) {
document.getElementById(dewey) + 100
} else if(dewey >= 400 && 500 >= dewey) {
document.getElementById(dewey) + 200
} else if(dewey >= 850 && 900 >= dewey) {
document.getElementById(dewey) - 100
} else if(dewey >= 600 && 650 >= dewey) {
document.getElementById(dewey) + 17
}
}
}
</script>
</head>
<body>
<h4>Records to Change</h4>
<ul id="myList">
<li id ="1">101.33</li>
<li id = "2">600.01</li>
<li id = "3">001.11</li>
<li id = "4">050.02</li>
<li id = "5">199.52</li>
<li id = "6">400.27</li>
<li id = "7">401.73</li>
<li id = "8">404.98</li>
<li id = "9">no number</li>
<li id = "10">850.68</li>
<li id = "11">853.88</li>
<li id = "12">407.8</li>
<li id = "13">878.22</li>
<li id = "14">175.93</li>
<li id = "15">175.9</li>
<li id = "16">176.11</li>
<li id = "17">190.97</li>
<li id = "18">90.01</li>
<li id = "19">191.001</li>
<li id = "20">600.95</li>
<li id = "21">602.81</li>
<li id = "22">604.14</li>
<li id = "23">701.31</li>
<li id = "24">606.44</li>
<li id = "25">141.77</li>
</ul>
<b> </b>
<input type="button" value="Click To Run" onclick="RipIt()">
<!-- <input type="button" value="Click Here" onClick="showAlert();"> -->
</body>
</html>