如何使用脚本获得选择项的的value或者text
aspx:
<asp:RadioButtonList  ID="radioMode" RepeatDirection="Horizontal" Runat="server">
     <asp:ListItem Value="0">a1</asp:ListItem>
     <asp:ListItem Value="1">a2</asp:ListItem>
     <asp:ListItem Value="2">a3</asp:ListItem>
     <asp:ListItem Value="3">a4</asp:ListItem>
</asp:RadioButtonList></td>cs:
 radioMode.Attributes.Add("onClick","show()");  ---- 加到这里不对 :(  这里的radioMode是个table,关键这个onClick应该加到哪里? 
 

解决方案 »

  1.   

    for(int i=0;i<radioMode.item.count; i++)
    radiomode.item[i].attributes.add("onclick", "show();");
      

  2.   

    确实用radioMode.Attributes.Add("onClick","show()");function GetCount(obj)
    {
    for (var i = 0; i < obj.rows.length; i ++)
    {
    for (var j = 0; j < obj.rows[i].cells.length;j ++)
    {
    oneCell = obj.rows[i].cells[j];
    if (oneCell.firstChild!="undefined" && oneCell.firstChild.value!="undefined")
    {
    if (oneCell.firstChild.checked)
    {
    alert(oneCell.firstChild.value;
    }
    }
    }
    }
    }
      

  3.   

    tomtown530(梦想一定会实现!)  的方法哦也试过的 onClick根本加不进去的 正在试duwx(daledu) 的方法
      

  4.   

    搞定 duwx(daledu) 的思路不错 就当table处理好了哈哈