How to unhide passwords – on your site and everywhere else
In his recent post Stop Password Masking Jacob Nielsen suggests to abandon the practice of masking passwords (i.e. showing ●●●● instead of regular text). Though I do agree with him for the biggest part, I think he’s absolutely wrong in proposing to make passwords readable by default.
In my opinion, the best solution would be to leave passwords hidden, but to provide the users with an easy way to toggle between the hidden and unhidden states. To help you do so, I have created three ready-to-use solutions for two scenario’s:
- You want to allow visitors of your site to toggle their passwords
- You are a visitor yourself and want to toggle passwords on every site on the internet
1. Allow your visitors to toggle their passwords
On your own site, you can add links saying “Show passwords” (or any other text) next to your password fields. Clicking one of these links toggles all passwords on the page. Try the example below:
To implement this, just put this togglePasswords.js file at the end of your
<body> section. The script then adds a link next to each password field. You can easily change the link texts for showing and hiding, and each link gets a class
pwToggler to allow easy styling. I’ve created an example page which shows the basic implementation.
2. Toggle passwords on every site on the internet
To let you toggle passwords easily everywhere else, I have created another two little tools: a bookmarklet and a Greasemonkey script.
To use the bookmarklet on other sites, simply drag the link into your bookmarks toolbar, or right-click it and select “Bookmark This Link”. (Internet Explorer won’t allow you to drag the link. Select “Add to Favorites…”, and confirm the warning message.)
(Note that the different toggling solutions do interfere with one another. Each one works only when you first it when the passwords are hidden.)
Google login with userscript
Download the example files
This .zip file contains all the examples from this post.
What do you think?
In the last few days since I have developed them, I have found these scripts quite useful. But what’s your opinion? Please let me know in the comments.
Share your thoughts
Follow me on Twitter