Triggering Click event in .aspx page

Triggering Click event in .aspx page

New to JQuery and trying to create some functionality.

I have a Visual Studio 2008 project. I have two buttons. I need the click event to fire one of two buttons based on whether either of them is visible when the enter key is pressed. The buttons are not visible by default. I have code that shows or hides them based on user options. I need to add an if statement that will account for whether one or the other is visible. I do have a text box so maybe attach this to the focus of the text box so if the user hits the enter key outside the text box it won't fire the click event prematurely. Any help is much appreciated.


Here is what I have that is not working:

==============================

<head id="Head1" runat="server">
    <link rel="Stylesheet" type="text/css" href="CSSFiles/main.css" />
    <title></title>
    <style type="text/css">
        .style5
        {
            width: 342px;
        }
    </style>
    <script type="text/jscript"  src="//jquery.js">

        $("#form1").keyup(function(event) {
            if (event.keyCode == 13) {
                $("#ExportToExcelButton").click();
            }
        });
 
    </script>
</head>
<body>
    <form id="form1" runat="server" >

==============================

<asp:Button ID="viewReportButton" runat="server" Text="View Report" CssClass="btnGradientBlue"
                                        Height="25" Width="100" Visible="false" />
                                    &nbsp;
<asp:Button ID="ExportToExcelButton" runat="server" Text="View Grid" CssClass="btnGradientBlue"
                                        Height="25" Width="100" Visible="false" />

==============================