为什么<input id=bclick type="button" value="button" />运行时提示bclick没定义?

写了一段代码:

<script type="text/javascript" language=javascript>
       $(function () { $(bclick).click(AjAX)})

       function AjAX() {
           $.ajax({
               type: "post",
               url: "Handler1.ashx",
               success: function (msg) { alert(msg) }
           })
       }
    </script>

<body>
    <form id="form1" runat="server">

   <input id=bclick type="button" value="button" /> 

    </form>
</body>

点击button时提示bclick没定义,bclick明明已经定义了??

九州编程
浏览 459回答 2
2回答

料青山看我应如是

将$(bclick)改为$("#bclick")
打开App,查看更多内容
随时随地看视频慕课网APP