如何根据选中的单选按钮显示div。

如何根据选中的单选按钮显示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>

检查下面的代码



Check below code

<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 %>";


(document).ready(function(){
(document).ready(function () {


(#MainContent_RadioButtonList1)。click(function(){

if(
("#MainContent_RadioButtonList1").click(function () { if (