当前位置: 代码迷 >> 综合 >> 全球鹰虚拟定位安卓版
  详细解决方案

全球鹰虚拟定位安卓版

热度:11   发布时间:2023-09-09 08:42:02.0
全球鹰虚拟定位安卓版

复制代码 代码如下:

/**
* @author georgewing
*/
function prepareCheckBox() {
document.getElementById("submit").onclick = function() {
selectedCheckBox(4);
}
}
function selectedCheckBox(x) {
var oInput = document.getElementsByTagName("input");
var iTotal = 0;
for(var i=0;i<oInput.length;i++) {
if(oInput[i].className == "checkedRadio") {
if(oInput[i].checked) {
//add x point
iTotal = iTotal + x;
}
else {
// add 0 point
iTotal = iTotal + 0;
}
}

}
document.getElementById("Total").setAttribute("value", iTotal);
alert(iTotal);
}

提示:把常量4抽象化为变量x,作为了函数的参数。这是硬编码抽象化,有关硬编码、抽象化的具体内容见《DOM scripting》译书的部分。

全球鹰虚拟定位安卓版
  相关解决方案