The code does not work anywhere - console.log does not work inside the function.
Where is the mistake?
$( "#form-login" ).submit(function( event ) { console.log('here'); alert( "Handler for .submit() called." ); event.preventDefault(); }); <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"> </script> <form id="form-login" method="post"> <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> <input class="mdl-textfield__input" name='login' type="email" id="login"> <label class="mdl-textfield__label" for="login">Логин</label> </div> <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> <input class="mdl-textfield__input" name='password' type="password" id="password"> <label class="mdl-textfield__label" for="password">Пароль</label> </div> <div class="mdl-card__actions"> <button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent buttons-login">Вход </button> </div> </form>