-
-
Save oppara/3879321 to your computer and use it in GitHub Desktop.
パスワードを伏せずに入力できるようにする
This file contains hidden or 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="ja"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
| <script> | |
| $(function() { | |
| var changeMaskPasswd = function() { | |
| $('.passwd')[0].type = | |
| $('.mask-passwd')[0].checked ? 'password' :'text'; | |
| } | |
| $('.mask-passwd').click(function() { | |
| changeMaskPasswd(); | |
| }); | |
| changeMaskPasswd(); | |
| }); | |
| </script> | |
| </head> | |
| <body> | |
| <form method="POST" action="login"> | |
| ユーザー名: | |
| <input type="text" name="username"><br> | |
| パスワード: | |
| <input class="passwd" type="password" name="password" autocomplete="off"><br> | |
| <label><input type="checkbox" checked="checked" | |
| class="mask-passwd">パスワードを伏せる</label> | |
| <br><input type="submit" value="ログイン"> | |
| </form> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment