Created
May 25, 2019 18:24
-
-
Save codetycon/59b86929205e639a4b7f1bd06152e057 to your computer and use it in GitHub Desktop.
Show to hide/show password jQuery
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
jQuery('span.show-password').click(function(){ | |
var passfield = jQuery('input[name="password"]'); | |
if(passfield.attr('type')=='password'){ | |
passfield.attr('type','text'); | |
}else if(passfield.attr('type')=='text'){ | |
passfield.attr('type','password'); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment