• [原创]如何得到RadioButtonList 中的选中值


    1<asp:RadioButtonList id="RadioButtonList1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 144px"
    2 runat="server">
    3 <asp:ListItem Value="a" >a</asp:ListItem>
    4 <asp:ListItem Value="b" Selected="True">b</asp:ListItem>
    5 <asp:ListItem Value="c">c</asp:ListItem>
    6 </asp:RadioButtonList>


    1 <script language="javascript">
    2 function getRadio()
    3 {
    4 var opts = document.all("RadioButtonList1");
    5 if (opts)
    6 {
    7 for (var i = 0; i < opts.length; i++)
    8 {
    9 if (opts[i].checked)
    10 {
    11 alert(i);
    12 break;
    13 }
    14 }
    15 }
    16 }
    17 getRadio();
    18
    19 </script>
  • 相关阅读:
    今日小结 5.7
    今日小结 5.2
    今日小结 4.30
    今日小结 4.29
    设计模式 笔记1
    第一次找实习
    Java入门 任务表
    今日小结 4.24
    今日小结 4.18
    今日小结 4.17
  • 原文地址:https://www.cnblogs.com/goody9807/p/142487.html
Copyright © 2020-2023  润新知