Q:

Why Div is not visible on button click

in my webpage i set visibility of a div hidden and i want to show it on button click,so i am writing a jquery code for it.
but some how it is not working
my asp code is
<asp:Button ID="btnGenerate" CssClass="button" runat="server" Text="Generate" OnClick="btnGenerate_Click" />
<div id="print" style="width: 80%; margin-left: 10%; margin-top: 20px;visibility:hidden;">                
    <input type="button" id="btnPrint" class="button" value="Print" onclick="printDiv('ReportDiv')"/>
</div>

and my jquery code for it is:
 <script>
    $(document).ready(function () {
        $("#btnGenerate").click(function () {
            $("#print").css("visibility", "visible");
        });
    });
</script>

please help me to fix this issue.
Thanks

A:

try it
<script>
      $(document).ready(function () {
          $("#<%= btnGenerate.ClientID %>").click(function () {
             $("#print").css("visibility", "visible");
          });
      });
</script>

you can not get asp.net button click in jquery using $("#btnGenerate") if you want to use asp.net button in jquery then you will have to use like this $("#<%= btnGenerate.ClientID %>")

