参考答案:
代码语言:javascript复制var domList = document.getElementsByTagName("input");
var ckList = []; // 返回的所有的 checkbox
var len = domList.length;
for (var i = 0; i < len; i ) {
if (domList[i].type == "checkbox") {
ckList.push(domList[i]);
}
}