How to submit form through jQuery onblur
问题 So I am trying to submit the form through jQuery onblur (i.e. As soon as the focus leaves the password field, form submits through jQuery). There are similar questions but it's not what I am looking for. I tried using the document.getElementById but it isn't working. Any help is appreciated. Thanks in advance. <script> $(function(){ $("#pswd").blur({ $("#myForm").submit(); }); }); </script> 回答1: As @dvenkatsagar suggested, you have some syntax errors, Live Preview: http://codepen.io