首页 > Web开发 > 详细

<asp:RadioButton> 选项判断

时间:2017-09-05 01:21:06      阅读:414      评论:0      收藏:0      [点我收藏+]

小菜在项目中遇到一个<asp:RadioButton> 选择之后,让其控制其他标签显示或者隐藏的问题。记录以备忘记之需!

 

技术分享
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script src="Scripts/jquery-3.1.1.min.js"></script>
    <title></title>
    <script>
        $(function () {
            $(".test :input").bind("click", function (event) {
                var selectIndex = $(".test :input").index($(this));
                alert(selectIndex);
                if (selectIndex == 0) {
                    $("#div1").hide();
                } else
                    $("#div1").show();
            });
        });

    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:RadioButton ID="RadioButton1" CssClass="test" GroupName="test"  runat="server" Text="是" />&nbsp;
        <asp:RadioButton ID="RadioButton2" CssClass="test" GroupName="test"  runat="server" Text="否" />
        <div id="div1"> ssadasdasfasd</div>
    </div>
    </form>
</body>
</html>
View Code

 

<asp:RadioButton> 选项判断

原文:http://www.cnblogs.com/bmyblogs/p/7476441.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!