Код не работает нигде - console.log
не срабатывает внутри функции.
В чём ошибка?
$( "#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>