如果在c#中可以用
test.SelectedItem.Text取文本
用test.SelectedItem.Value取值
<script language="javascript">
alert(document.all.form1.test[document.all.form1.test.selectedIndex].text);
</script>

解决方案 »

  1.   

    no such things on the client side, the best you could do is something like<input type="button" value="showText" onclick="javascript:getSel('test')">
    <script language="javascript">
    function getSel(sName)
    {
      var list = document.getElementsByName(sName);
      var sText = "";
      for (var i=0; i < list.length; i++)
      {
    if (list[i].tagName == "INPUT" && list[i].checked)
    {
    var id = list[i].id;
    var o = document.all[list[i].sourceIndex+1];
    if (o.tagName == "LABEL" && o.htmlFor == id)
    sText = o.innerText;
    else
    {
    o = document.all[list[i].sourceIndex-1];
    if (o.tagName == "LABEL" && o.htmlFor == id)
    sText = o.innerText;
    }
    }
      }  alert(sText);
    }
    </script>