Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //HTML
- <div class="ic-single-input ic-show-hide">
- <label for="password">Email Address</label>
- <span>Min 6 character passwords</span>
- <input id="password-field" type="password" class="form-control" name="password" value="secret"><span toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password"></span>
- </div>
- // hide and show passwords
- $(".toggle-password").click(function() {
- $(this).toggleClass("fa-eye fa-eye-slash");
- var input = $($(this).attr("toggle"));
- if (input.attr("type") == "password") {
- input.attr("type", "text");
- } else {
- input.attr("type", "password");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement