Skip to content

Instantly share code, notes, and snippets.

@kuznetsovandrey76
Created October 15, 2018 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuznetsovandrey76/14c0d037f973bcb7635a10c9784c6073 to your computer and use it in GitHub Desktop.
Save kuznetsovandrey76/14c0d037f973bcb7635a10c9784c6073 to your computer and use it in GitHub Desktop.
Auth
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Авторизация</title>
</head>
<body>
<input id="login" type="text" placeholder="Логин"><br>
<input id="password" type="password" placeholder="Пароль">
<span id="show_password">Показать пароль</span><br>
<a href="#" id="remind_password">Напомнить пароль</a><br>
<input id="enter" type="submit" value="Войти">
<script>
$(document).ready(function() {
$('#show_password').click(function() {
var type = $('#password').attr('type') == "text" ? "password" : 'text',
temp = $(this).text() == "Скрыть пароль" ? "Показать пароль" : "Скрыть пароль";
$(this).text(temp);
$('#password').prop('type', type);
});
$('#remind_password').click(function() {
console.log('Напомнить пароль');
})
$('#enter').click(function() {
var login = $('#login').val();
var password = $('#password').val();
console.log(login, password);
})
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment