This code is not working

This code is not working

  1. <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <script type="text/javascript" src="jquery-1.4.1.js"></script>
        <script language="javascript" type="text/javascript">
            $("#<%=btn1.ClientID%>").click(function() {
                alert("test");
            });
        </script>

        <form runat="server" id="myid">
            <asp:Button runat="server"  ID="btn1"   />
        </form>
    </asp:Content>











When I put the script after the form tag it works. Is that how its supposed to be?