jquery submit()不能提交表單的的原因

複製代碼 代碼如下:

jquery submit()不能提交表單的的原因

用戶名:

密碼:

郵箱:

改爲

$("#submit")k(function() {

$("form")it();

});

上述代碼點擊註冊按鈕時無法提交表單

原因

Additional Notes:

Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see DOMLint.

其他注意事項:

表單和其子元素不宜用一個表單的`屬性的屬性作爲name或id的名稱,如submit, length, or method,是、會產生衝突。名稱衝突可能會導致混亂的失敗。對於一個完整的規則列表,並檢查這些問題標記,看DOMLint。

所以將註冊按鈕的id改爲“register”就OK了