Skip to content

Instantly share code, notes, and snippets.

@codetycon
Created May 25, 2019 18:24
Show Gist options
  • Save codetycon/59b86929205e639a4b7f1bd06152e057 to your computer and use it in GitHub Desktop.
Save codetycon/59b86929205e639a4b7f1bd06152e057 to your computer and use it in GitHub Desktop.
Show to hide/show password jQuery
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