tags:

views:

31

answers:

1

I have a button on click of which i want to either show/hide a content which is places in a div. How can we implement this? Also whats the error in the code below--

   <head runat="server">
   <title>Toggle Functionality</title>

<script src="jquery-1.3.1.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function(){
 $("button").click(function () {
 $("p").toggle("slow");
});
});
</script>

</head>
 <body>
<form id="frmQuery" runat="server">
    <table>
        <tr>
            <td>
         <asp:Button ID="imgForm" runat="server" ImageUrl="~/Image/Khushi1.jpg" />
            </td>
        </tr>

    </table>
     <p>
            Toggle displaying 
        </p>
</form>

        </body>
+1  A: 

The asp:Button control renders to an <input type="submit"> html element. So you should use

$("input[type=submit]")

instead of

$("button")
Jan Willem B