// 获取下拉框所选下标 传入下拉框的id function getselectscheckitemindex (idStr) { let o = document.getElementById(idStr).options for (let i = 0; i < o.length; i++) { if (o[i].selected == true) return i } }