Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>jQuery - Show/Hide Password Demo</title>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#showHide").click(function() {
- if ($(".password").attr("type") == "password") {
- $(".password").attr("type", "text");
- } else {
- $(".password").attr("type", "password");
- }
- });
- });
- </script>
- <style type="text/css">
- #showHide {
- width: 15px;
- height: 15px;
- float: left;
- }
- #showHideLabel {
- float: left;
- padding-left: 5px;
- }
- </style>
- </head>
- <body>
- <table>
- <tr>
- <td>Password:</td>
- <td><input type="password" name="password" class="password" size="25"></td>
- </tr>
- <tr>
- <td></td>
- <td>
- <input type="checkbox" id="showHide" />
- <label for="showHide" id="showHideLabel">Show Password</label>
- </td>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement