阅读:3904回复:3
全天在线,等待福音——解决options[i].innerText的问题
各位大虾大鱼,请教如何处理innerText的问题,下面是我的一段代码,是关于从下拉列表框选择功能。不全部贴了。
function removeOpItem(selectMain,selectSub,remove) { var nSelected = selectMain.length; if (selectMain.options.value!=""){ for(i=0;i<nSelected;i++) { if (selectMain.options.selected) { //firefox 如何处理option的innerText啊????? var sText = selectMain.options.innerText; var sVal = selectMain.options.value; if (remove==true) { if (selectOpItem(selectSub,sVal)){ return true; } } else { if (selectOpItem(selectSub,sVal)) { selectMain.remove(i); return true; } } var opt= new Option(sText,sVal); selectSub.add(opt); selectMain.remove(i); nSelected=nSelected-1; i=i-1; } } } else { if (remove==true) { alert("请从左边选择添加的目录!"); } else { alert("请从右边选择要删除的目录!"); } } } 怎么样解决select options.innerText的问题,希望得到不同的火花! |
|
1楼#
发布于:2006-02-24 11:55
斑竹去那了,我要投诉,等半天没回应!
|
|
2楼#
发布于:2006-02-24 11:55
Standards Information
There is no public standard that applies to this property. |
|
|
3楼#
发布于:2006-02-24 11:55
斑竹都是志愿者,并不是专职服务者...
<select onchange="alert(this[selectedIndex].textContent)"> <option value="aaa">123</option> <option value="bbb">456</option> </select> |
|