本文介绍了如何根据选中的单选按钮显示div。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个单选按钮并且打开两个不同的div我希望一次显示一个div基于单选按钮列表值如何做到这一点感谢你的帮助...







i am having two radio buttons and baving two different divs i want to display one div at a time based on radio buttons list value how to do it thanks for ur help...



<asp:RadioButtonList ID="RadioButtonList1" runat="server" ForeColor="White" BackColor="red" RepeatDirection="Horizontal"  >
                        <asp:ListItem Selected="True" Text="Movie"></asp:ListItem>
                        <asp:ListItem Text="Theater"></asp:ListItem>
                   </asp:RadioButtonList>









< img alt =src =newsite / coming1.jpgtitle =/>

< img alt =src =newsite / coming2.jpgtitle = />

< img alt =src =newsite / coming3.jpgtitle =/>


<img alt="" src="newsite/coming1.jpg" title="" />
<img alt="" src="newsite/coming2.jpg" title="" />
<img alt="" src="newsite/coming3.jpg" title="" />










                           <img alt="" src="newsite/old1.jpg" title="" />
   <img alt="" src="newsite/old2.jpg" title="" />
</div></div></div>

推荐答案

<asp:RadioButtonList ID="RadioButtonList1" runat="server" ForeColor="White" BackColor="red"

    RepeatDirection="Horizontal">
    <asp:ListItem Selected="True" Text="Movie"></asp:ListItem>
    <asp:ListItem Text="Theater"></asp:ListItem>
</asp:RadioButtonList>
<div id="test1" style="display: none">
    first Div</div>
<div id="test2" style="display: none">
    second Div</div>
<script type="text/javascript">
    var rbAuth = "<%= RadioButtonList1.ClientID %>";




这篇关于如何根据选中的单选按钮显示div。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 14:25