2 回答

TA貢獻1827條經(jīng)驗 獲得超8個贊
//獲取全部選中CheckBox的值集合
function GetCheckedBox() {
??? var ids = "0";
??? var InputList = document.getElementsByTagName("input");
??? for (var j = 0; j < InputList.length; j++) {
??????? if (InputList[j].type == "checkbox" && InputList[j].id.indexOf('ChkDel') != -1) {
??????????? if (InputList[j].checked == true) {
??????????????? var abc = document.getElementById(InputList[j].id).parentNode.title;
??????????????? ids += "," + InputList[j].value;
??????????????? InputList[j].parentNode.parentNode.style.backgroundColor = '#F7F7F7';
??????????? }
??????????? else {
??????????????? InputList[j].parentNode.parentNode.style.backgroundColor = '#FFFFFF';
??????????? }
??????? }
??? }
??? return ids;
}
添加回答
舉報