摘要:
设置select中value="paraValue"的Item为选中 //document.all.objSelect.value = objItemValue; //得到select的当前选中项的value //var currSelectValue = document.all.objSelect.value; //得到select的当前选中项的text //var currSelectText = document.all.objSelect.options[document.all.objSelect.selectedIndex].text; //得到select的 阅读全文
2009年6月22日 #
摘要:
设置select中text="paraText"的第一个Item为选中 function jsSelectItemByValue(objSelect,objItemText) { //判断是否存在 var isExit = false; for(var i=0;i<objSelect.options.length;i++) { if(objSelect.options[i].text == objItemText) { objSelect.options[i].selected = true; isExit = true; break; } } //Show出结果 i 阅读全文