Created
October 15, 2018 07:15
-
-
Save kuznetsovandrey76/14c0d037f973bcb7635a10c9784c6073 to your computer and use it in GitHub Desktop.
Auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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