拜托各位,谢谢.
<select name= "CSDN " style= "width: 80pt; " >
<option value= "EF1EAEC45E01445F9347710F8E757458 " > 陈是 </option>
<option value= "FB1B63DA50F2452A9DAD11ABEE57E2A3 " selected > 徐先 </option>
<option value= "B57F8AA7E9CE4746A0C3E055CEF6D1B9 " > 袁梅 </option>
<option value= "4473CBC94FDA4B908CDD6C4A10BDFC7A " > 吴雄 </option>
<option value= "73DC6A83EAD440C99E653C201C33A192 " > 刘庆 </option>
<option value= "4473CBC94FDA4B908CDD6C4A10BDFC7A " > 国海 </option>
<option value= "EFF1F2713DD94022A4079256D79F69E4 " > 欧阳 </option>
<option value= "2D2953ACCCA944698606C43E94B31A70 " > 少梅 </option>
</select>
如果结构如上,请问我如何获取 "徐先 "这个值? (通过javascript)
------解决方案-------------------- <select name= "CSDN " style= "width: 80pt; " >
<option value= "EF1EAEC45E01445F9347710F8E757458 " > 陈是 </option>
<option value= "FB1B63DA50F2452A9DAD11ABEE57E2A3 " selected > 徐先 </option>
<option value= "B57F8AA7E9CE4746A0C3E055CEF6D1B9 " > 袁梅 </option>
<option value= "4473CBC94FDA4B908CDD6C4A10BDFC7A " > 吴雄 </option>
<option value= "73DC6A83EAD440C99E653C201C33A192 " > 刘庆 </option>
<option value= "4473CBC94FDA4B908CDD6C4A10BDFC7A " > 国海 </option>
<option value= "EFF1F2713DD94022A4079256D79F69E4 " > 欧阳 </option>
<option value= "2D2953ACCCA944698606C43E94B31A70 " > 少梅 </option>
</select>
<script>
o = document.getElementsByName( "CSDN ")[0];
for(c=0;c <o.length;c++)
{
if(o.options[c].text== "徐先 ") alert(o[c].value);
}
</script>
------解决方案-------------------- <script language= "JavaScript ">
<!--
alert(document.all.CSDN.options[document.all.CSDN.selectedIndex].innerText);
//-->
</script>
------解决方案-------------------- <select id= "CSDN " style= "width: 80pt; ">
<option value= "EF1EAEC45E01445F9347710F8E757458 " > 陈是 </option>
<option value= "FB1B63DA50F2452A9DAD11ABEE57E2A3 " selected > 徐先 </option>
<option value= "B57F8AA7E9CE4746A0C3E055CEF6D1B9 " > 袁梅 </option>
<option value= "4473CBC94FDA4B908CDD6C4A10BDFC7A " > 吴雄 </option>
<option value= "73DC6A83EAD440C99E653C201C33A192 " > 刘庆 </option>
<option value= "4473CBC94FDA4B908CDD6C4A10BDFC7A " > 国海 </option>
<option value= "EFF1F2713DD94022A4079256D79F69E4 " > 欧阳 </option>
<option value= "2D2953ACCCA944698606C43E94B31A70 " > 少梅 </option>
</select>
<script type= "text/javascript ">
obj=document.getElementById( "CSDN ");
alert(obj.options[obj.selectedIndex].text);
</script>