0
<html>
    <head>
        <script type="text/javascript" src="http://www.superpseudostocks.com/SPS/js/jquery-1.8.2.min.js"></script>
        <script type="text/javascript">
            $("#form").submit(function () {
                alert("click");
            });
        </script>
    </head>
    <body>
        <div style="width:517px; margin-top:20px;height:260px;">
            <form id="form" action="javascript:void(0);" method="POST">
                <fieldset style="height:200px;" id="Withdraw">
                    <legend><b><font size="4" color=black>Deposit</font></b>
                    </legend> <font color="black" size=4>Deposit funds into system balance from registered bank account</font>
                    <br>
                    <br>
                    <div style="width:480px; height:20px; margin: auto;" id="ErrorBox"></div>
                    <br> <span class="tab2"></span>
                    <label for='amount'><font color="black"><b>Please enter an amount to withdraw from bank account</b></font> </label>
                    <br> <span class="tab3"></span>$
                    <input type='text' name='Amount' id='Amount' maxlength="50" size="40" />
                    <br>
                    <br>
                    <input style="width:100px; height:40px;" type='SUBMIT' name='Confirm' value='Confirm' />
                </fieldset>
            </form>
        </div>
    </body>
</html>

私はしばらくこのコードを始めていて、何が間違っているのかわかりません。おそらく私のjQueryはリンクしていないと思いましたが、同じフォルダーにあります...そして私は確信が持てませんでしたそれが私の構文かどうか。

4

1 に答える 1

5

フォームが存在する前にバインドしています。次を使用して$(document).readyください:

$(document).ready(function() {
    $("#form").submit(function() {
        alert("click");
    });
});
于 2012-11-22T22:12:14.633 に答える