IE8下复选框的问题

$(window.frames["GB_frame"].document).find("input:checked[name=input]").each(function(){}; 我想找到所有选中的复选框,除了上面我写的,请问在IE8下还有没有别的方法啊?因为上面的与我所写代码相冲突

UYOU
浏览 503回答 2
2回答

长风秋雁

Astar方法是没错的,记得这个类型应该是大写的CHECKBOX

斯蒂芬大帝

//获取全部选中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;}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript